Amazon Cognito Sync examples using SDK for Rust - AWS SDK for Rust

Amazon Cognito Sync examples using SDK for Rust

The following code examples show you how to perform actions and implement common scenarios by using the AWS SDK for Rust with Amazon Cognito Sync.

Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

Each example includes a link to the complete source code, where you can find instructions on how to set up and run the code in context.

Topics

Actions

The following code example shows how to use ListIdentityPoolUsage.

SDK for Rust
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

async fn show_pools(client: &Client) -> Result<(), Error> { let response = client .list_identity_pool_usage() .max_results(10) .send() .await?; let pools = response.identity_pool_usages(); println!("Identity pools:"); for pool in pools { println!( " Identity pool ID: {}", pool.identity_pool_id().unwrap_or_default() ); println!( " Data storage: {}", pool.data_storage().unwrap_or_default() ); println!( " Sync sessions count: {}", pool.sync_sessions_count().unwrap_or_default() ); println!( " Last modified: {}", pool.last_modified_date().unwrap().to_chrono_utc()? ); println!(); } println!("Next token: {}", response.next_token().unwrap_or_default()); Ok(()) }