Struct rusty_s3::actions::ListObjectsV2
source · 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_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.
pub fn parse_response(s: &str) -> Result<ListObjectsV2Response, DeError>
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