fn list_items_in_bucket_paged_v2(client: &TestClient, bucket: &str) {
    let mut list_obj_req = ListObjectsV2Request {
        bucket: bucket.to_owned(),
        max_keys: Some(1),
        ..Default::default()
    };
    let result1 = client.list_objects_v2(list_obj_req.clone()).sync().expect("list objects v2 failed");
    println!("Items in bucket, page 1: {:#?}", result1);
    assert!(result1.next_continuation_token.is_some());

    list_obj_req.continuation_token = result1.next_continuation_token;
    let result2 = client.list_objects_v2(list_obj_req).sync().expect("list objects v2 paging failed");
    println!("Items in bucket, page 2: {:#?}", result2);
    // For the second call it the token is in `continuation_token` not `next_continuation_token`
    assert!(result2.continuation_token.is_some());
    assert!(
        result1.contents.unwrap()[0].key.as_ref().unwrap()
            < result2.contents.unwrap()[0].key.as_ref().unwrap()
    );
}
// Assuming there's already more than three item in our test bucket:
Assuming there's already more than three item in our test bucket.
Assuming there ' s already more than three item in our test bucket .
fn list_items_in_bucket_paged_v2(client: &TestClient, bucket: &str) {
    let mut list_obj_req = ListObjectsV2Request {
        bucket: bucket.to_owned(),
        max_keys: Some(1),
        ..Default::default()
    };
    let result1 = client.list_objects_v2(list_obj_req.clone()).sync().expect("list objects v2 failed");
    println!("Items in bucket, page 1: {:#?}", result1);
    assert!(result1.next_continuation_token.is_some());
    list_obj_req.continuation_token = result1.next_continuation_token;
    let result2 = client.list_objects_v2(list_obj_req).sync().expect("list objects v2 paging failed");
    println!("Items in bucket, page 2: {:#?}", result2);
    // For the second call it the token is in `continuation_token` not `next_continuation_token`
    assert!(result2.continuation_token.is_some());
    assert!(
        result1.contents.unwrap()[0].key.as_ref().unwrap()
            < result2.contents.unwrap()[0].key.as_ref().unwrap()
    );
}
fn list_items_in_bucket_paged_v2 ( client : & TestClient , bucket : & str ) { let mut list_obj_req = ListObjectsV2Request { bucket : bucket . to_owned ( ) , max_keys : Some ( 1 ) , .. Default :: default ( ) } ; let result1 = client . list_objects_v2 ( list_obj_req . clone ( ) ) . sync ( ) . expect ( " " ) ; println ! ( " " result1 ) ; assert ! ( result1 next_continuation_token is_some ( ) ) ; list_obj_req . continuation_token = result1 . next_continuation_token ; let result2 = client . list_objects_v2 ( list_obj_req ) . sync ( ) . expect ( " " ) ; println ! ( " " result2 ) ; // For the second call it the token is in `continuation_token` not `next_continuation_token` assert ! ( result2 continuation_token is_some ( ) ) ; assert ! ( result1 contents unwrap ( ) [ 0 ] key as_ref ( ) unwrap ( ) result2 contents unwrap ( ) [ 0 ] key as_ref ( ) unwrap ( ) ) ; }
Assuming there's already more than three item in our test bucket:
Assuming there ' s already more than three item in our test bucket :
client
&TestClient
bucket
&str
client
&TestClient
bucket
&str