Skip to content

Commit

Permalink
object_store: Clarify what is a prefix in list() documentation
Browse files Browse the repository at this point in the history
It should be obvious to reader that `foo/bar/` is not a prefix of
`foo/bar_baz`, because it is true whether they think in term of
strings, S3-like API paths, or POSIX-like paths.

What is less clear is that `foo/bar` is also not a prefix of `foo/bar_baz`,
because this is not true with strings or S3-like API paths, only of
POSIX-like paths.

Additionally, the definition of paths
(https://docs.rs/object_store/0.11.0/object_store/path/struct.Path.html)
says that paths cannot have a trailing `/`.
  • Loading branch information
progval committed Oct 7, 2024
1 parent e67f17e commit 7c7c781
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions object_store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ pub trait ObjectStore: std::fmt::Display + Send + Sync + Debug + 'static {

/// List all the objects with the given prefix.
///
/// Prefixes are evaluated on a path segment basis, i.e. `foo/bar/` is a prefix of `foo/bar/x` but not of
/// Prefixes are evaluated on a path segment basis, i.e. `foo/bar` is a prefix of `foo/bar/x` but not of
/// `foo/bar_baz/x`. List is recursive, i.e. `foo/bar/more/x` will be included.
///
/// Note: the order of returned [`ObjectMeta`] is not guaranteed
Expand All @@ -742,7 +742,7 @@ pub trait ObjectStore: std::fmt::Display + Send + Sync + Debug + 'static {
/// delimiter. Returns common prefixes (directories) in addition to object
/// metadata.
///
/// Prefixes are evaluated on a path segment basis, i.e. `foo/bar/` is a prefix of `foo/bar/x` but not of
/// Prefixes are evaluated on a path segment basis, i.e. `foo/bar` is a prefix of `foo/bar/x` but not of
/// `foo/bar_baz/x`. List is not recursive, i.e. `foo/bar/more/x` will not be included.
async fn list_with_delimiter(&self, prefix: Option<&Path>) -> Result<ListResult>;

Expand Down

0 comments on commit 7c7c781

Please sign in to comment.