Skip to content

Commit 0b32a89

Browse files
authored
Lots of doc tweaks and cleanups (smithy-lang#693)
1 parent 60b6635 commit 0b32a89

File tree

23 files changed

+136
-81
lines changed

23 files changed

+136
-81
lines changed

aws/rust-runtime/aws-config/src/default_provider.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
* SPDX-License-Identifier: Apache-2.0.
44
*/
55

6-
//! Default Provider chains for [`region`](default_provider::region) and credentials (TODO)
6+
//! Default Provider chains for [`region`](default_provider::region) and [`credentials`](default_provider::credentials).
7+
//!
8+
//! Unless specific configuration is required, these should be constructed via [`ConfigLoader`](crate::ConfigLoader).
9+
//!
10+
//!
711
812
/// Default region provider chain
913
pub mod region {

aws/rust-runtime/aws-config/src/lib.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#![deny(missing_docs)]
22

3-
//! `aws-config` provides implementations of region, credential (todo), and connector (todo) resolution.
3+
//! `aws-config` provides implementations of region, credential resolution.
4+
//!
5+
//! These implementations can be used either via the default chain implementation
6+
//! [`from_env`]/[`ConfigLoader`] or ad-hoc individual credential and region providers.
47
//!
5-
//! These implementations can be used either adhoc or via [`from_env`](from_env)/[`ConfigLoader`](ConfigLoader).
68
//! [`ConfigLoader`](ConfigLoader) can combine different configuration sources into an AWS shared-config:
79
//! [`Config`](aws_types::config::Config). [`Config`](aws_types::config::Config) can be used configure
810
//! an AWS service client.
911
//!
10-
//! ## Examples
12+
//! # Examples
1113
//! Load default SDK configuration:
1214
//! ```rust
1315
//! # mod aws_sdk_dynamodb {
@@ -66,7 +68,7 @@ pub mod provider_config;
6668

6769
/// Create an environment loader for AWS Configuration
6870
///
69-
/// ## Example
71+
/// # Examples
7072
/// ```rust
7173
/// # async fn create_config() {
7274
/// use aws_types::region::Region;
@@ -112,7 +114,7 @@ mod loader {
112114
impl ConfigLoader {
113115
/// Override the region used to build [`Config`](aws_types::config::Config).
114116
///
115-
/// # Example
117+
/// # Examples
116118
/// ```rust
117119
/// # async fn create_config() {
118120
/// use aws_types::region::Region;
@@ -127,7 +129,7 @@ mod loader {
127129
}
128130

129131
/// Override the credentials provider used to build [`Config`](aws_types::config::Config).
130-
/// # Example
132+
/// # Examples
131133
/// Override the credentials provider but load the default value for region:
132134
/// ```rust
133135
/// # use aws_types::Credentials;

aws/rust-runtime/aws-config/src/meta/credentials/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use tracing::Instrument;
1818
/// the next provider will be checked.
1919
/// * Finally, if a provider returns any other error condition, an error will be returned immediately.
2020
///
21-
/// ## Example
21+
/// # Examples
2222
/// ```rust
2323
/// use aws_config::meta::credentials::CredentialsProviderChain;
2424
/// use aws_types::Credentials;

aws/rust-runtime/aws-config/src/meta/credentials/credential_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ where
3636
/// to create an [`ProvideCredentials`] implementation from an async block that returns
3737
/// a [`credentials::Result`].
3838
///
39-
/// # Example
39+
/// # Examples
4040
///
4141
/// ```
4242
/// use aws_types::Credentials;

aws/rust-runtime/aws-config/src/meta/credentials/lazy_caching.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ mod builder {
125125

126126
/// Builder for constructing a [`LazyCachingCredentialsProvider`].
127127
///
128-
/// # Example
128+
/// # Examples
129129
///
130130
/// ```
131131
/// use aws_types::Credentials;

aws/rust-runtime/aws-config/src/meta/credentials/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* SPDX-License-Identifier: Apache-2.0.
44
*/
55

6+
//! Credential providers that augment an existing credentials providers to add functionality
7+
68
mod chain;
79
pub use chain::CredentialsProviderChain;
810

aws/rust-runtime/aws-config/src/meta/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0.
44
*/
55

6-
/// Region Providers
76
pub mod region;
87

9-
/// Credential Providers
108
pub mod credentials;

aws/rust-runtime/aws-config/src/meta/region.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
* SPDX-License-Identifier: Apache-2.0.
44
*/
55

6+
//! Region providers that augment existing providers with new functionality
7+
68
use aws_types::region::Region;
79
use std::borrow::Cow;
810
use std::fmt::Debug;
911
use tracing::Instrument;
1012

1113
/// Load a region by selecting the first from a series of region providers.
1214
///
13-
/// # Example
15+
/// # Examples
1416
/// ```rust
1517
/// use aws_types::region::Region;
1618
/// use std::env;

aws/rust-runtime/aws-config/src/profile/credentials.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ pub struct Builder {
293293
impl Builder {
294294
/// Override the configuration for the [`ProfileFileCredentialsProvider`]
295295
///
296-
/// # Example
296+
/// # Examples
297297
/// ```rust
298298
/// # async fn test() {
299299
/// use aws_config::profile::ProfileFileCredentialsProvider;
@@ -310,7 +310,7 @@ impl Builder {
310310

311311
/// Adds a custom credential source
312312
///
313-
/// # Example
313+
/// # Examples
314314
///
315315
/// ```rust
316316
/// use aws_types::credentials::{self, ProvideCredentials, future};

aws/rust-runtime/aws-config/src/profile/credentials/exec.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::web_identity_token::{StaticConfiguration, WebIdentityTokenCredentials
1818
use aws_types::credentials::{self, CredentialsError, ProvideCredentials};
1919
use aws_types::os_shim_internal::Fs;
2020
use smithy_client::erase::DynConnector;
21-
use std::fmt::{Debug, Formatter};
21+
use std::fmt::Debug;
2222

2323
#[derive(Debug)]
2424
pub struct AssumeRoleProvider {
@@ -66,18 +66,12 @@ impl AssumeRoleProvider {
6666
}
6767
}
6868

69+
#[derive(Debug)]
6970
pub(super) struct ProviderChain {
7071
base: Arc<dyn ProvideCredentials>,
7172
chain: Vec<AssumeRoleProvider>,
7273
}
7374

74-
impl Debug for ProviderChain {
75-
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
76-
// TODO: ProvideCredentials should probably mandate debug
77-
f.debug_struct("ProviderChain").finish()
78-
}
79-
}
80-
8175
impl ProviderChain {
8276
pub fn base(&self) -> &dyn ProvideCredentials {
8377
self.base.as_ref()

0 commit comments

Comments
 (0)