Skip to content

Commit

Permalink
Add with_delimiter for list method (#104)
Browse files Browse the repository at this point in the history
Co-authored-by: Paolo Barbolini <paolo@paolo565.org>
  • Loading branch information
giangndm and paolobarbolini authored Jul 20, 2024
1 parent b8e728e commit a7e6ebe
Showing 1 changed file with 13 additions and 0 deletions.
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.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

0 comments on commit a7e6ebe

Please sign in to comment.