I tried doing the following, but I can't seem to get the continuation token for getting the next batch of objects after 1000.
(Access keys loaded through environment variables)
let s3 = S3Client::new(Region::Custom {
name: String::from(""), // region name in endpoint
endpoint: String::from("https://sgp1.digitaloceanspaces.com"),
});
let mut request = ListObjectsV2Request {
bucket: String::from("my_cool_bucket"),
..Default::default()
};
let result = s3.list_objects_v2(request.clone()).await?;
assert!(result.next_continuation_token.is_some()); // <-- panics here
I'm actually trying to port some code from python, and boto3's resource API is smart enough to fetch objects all in one go.
s3 = boto3.resource(
"s3",
aws_access_key_id="...",
aws_secret_access_key="...",
endpoint_url="https://sgp1.digitaloceanspaces.com",
)
s3.Bucket("my_cool_bucket")
print(list(bucket.objects.all())) # all 21399 fetched in a single call
This is my first day of rust, please forgive me if this is due to some rookie mistake