Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add with_delimiter for list method #104

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/actions/list_objects_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ impl<'a> ListObjectsV2<'a> {
self.query_mut().insert("prefix", prefix);
}

/// A delimiter is a character that you use to group keys.
///
/// See https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_RequestSyntax for more infos.
/// # Example
/// ```
/// # let bucket = rusty_s3::Bucket::new(url::Url::parse("http://rusty_s3/").unwrap(), rusty_s3::UrlStyle::Path, "doggo", "doggoland").unwrap();
/// let mut list = bucket.list_objects_v2(None);
/// list.delimiter("/");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// list.delimiter("/");
/// list.with_delimiter("/");

/// ```
pub fn with_delimiter(&mut self, delimiter: impl Into<Cow<'a, str>>) {
self.query_mut().insert("delimiter", delimiter);
}

/// StartAfter is where you want Amazon S3 to start listing from.
/// Amazon S3 starts listing after this specified key.
/// StartAfter can be any key in the bucket.
Expand Down
Loading