pub struct ListObjectsV2<'a> { /* private fields */ }Expand description
List all objects in the bucket.
If next_continuation_token is Some the response is truncated, and the
rest of the list can be retrieved by reusing the ListObjectV2 action
but with continuation-token set to the value of next_continuation_token
received in the previous response.
Find out more about ListObjectsV2 from the AWS API Reference
Implementations§
Source§impl<'a> ListObjectsV2<'a>
impl<'a> ListObjectsV2<'a>
pub fn new(bucket: &'a Bucket, credentials: Option<&'a Credentials>) -> Self
Sourcepub fn with_prefix(&mut self, prefix: impl Into<Cow<'a, str>>)
pub fn with_prefix(&mut self, prefix: impl Into<Cow<'a, str>>)
Limits the response to keys that begin with the specified prefix.
See https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_RequestSyntax for more infos.
§Example
let mut list = bucket.list_objects_v2(None);
list.with_prefix("tamo");Sourcepub fn with_delimiter(&mut self, delimiter: impl Into<Cow<'a, str>>)
pub fn with_delimiter(&mut self, delimiter: impl Into<Cow<'a, str>>)
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 mut list = bucket.list_objects_v2(None);
list.with_delimiter("/");Sourcepub fn with_start_after(&mut self, start_after: impl Into<Cow<'a, str>>)
pub fn with_start_after(&mut self, start_after: impl Into<Cow<'a, str>>)
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.
See https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_RequestSyntax for more infos.
§Example
let mut list = bucket.list_objects_v2(None);
list.with_start_after("tamo"); // <- This token should come from a previous call to the list API.Sourcepub fn with_continuation_token(
&mut self,
continuation_token: impl Into<Cow<'a, str>>,
)
pub fn with_continuation_token( &mut self, continuation_token: impl Into<Cow<'a, str>>, )
ContinuationToken indicates to Amazon S3 that the list is being continued on this bucket with a token.
ContinuationToken is obfuscated and is not a real key.
See https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_RequestSyntax for more infos.
§Example
let mut list = bucket.list_objects_v2(None);
list.with_continuation_token("tamo"); // <- This token should come from a previous call to the list API.Sourcepub fn with_max_keys(&mut self, max_keys: usize)
pub fn with_max_keys(&mut self, max_keys: usize)
Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.
See https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_RequestSyntax for more infos.
§Example
let mut list = bucket.list_objects_v2(None);
list.with_continuation_token("tamo"); // <- This token should come from a previous call to the list API.Sourcepub fn parse_response(
s: impl AsRef<[u8]>,
) -> Result<ListObjectsV2Response, DeError>
pub fn parse_response( s: impl AsRef<[u8]>, ) -> Result<ListObjectsV2Response, DeError>
Parse the XML response from S3 into a struct.
§Errors
Returns an error if the XML response could not be parsed.
Sourcepub fn parse_response_from_reader(
s: impl Read,
) -> Result<ListObjectsV2Response, DeError>
pub fn parse_response_from_reader( s: impl Read, ) -> Result<ListObjectsV2Response, DeError>
Parse the XML response from S3 into a struct.
§Errors
Returns an error if the XML response could not be parsed.
Trait Implementations§
Source§impl<'a> Clone for ListObjectsV2<'a>
impl<'a> Clone for ListObjectsV2<'a>
Source§fn clone(&self) -> ListObjectsV2<'a>
fn clone(&self) -> ListObjectsV2<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more