You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/09/19 03:28:45 UTC

[GitHub] [incubator-opendal] Xuanwo commented on issue #3127: suggestion: `stat` should return an `Entry` instead of just Metadata

Xuanwo commented on issue #3127:
URL: https://github.com/apache/incubator-opendal/issues/3127#issuecomment-1724780399

   The main block here is `Entry` is a composition of `Path` and `Metadata`. 
   
   There are two downsides:
   
   First, returning the `Entry` for `stat` requires an additional clone of the path (although it is not a significant issue in most cases).
   
   Secondly, the return of `Entry` causes all calls to our `stat` function to be changed from:
   
   ```diff
   - let v = op.stat(path).await?.content_length();
   + let v = op.stat(path).await?.metadata().content_length();
   ```
   
   I'm not sure if it's a good idea.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org