Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Smithy Rust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Public Repositories
Smithy Rust
Commits
572448b8
Unverified
Commit
572448b8
authored
3 years ago
by
Jon Gjengset
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix copy-paste errors in generated docs (#1313)
parent
7675210f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/client/FluentClientDecorator.kt
+60
-20
60 additions, 20 deletions
...codegen/smithy/generators/client/FluentClientDecorator.kt
with
60 additions
and
20 deletions
codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/client/FluentClientDecorator.kt
+
60
−
20
View file @
572448b8
...
...
@@ -184,37 +184,77 @@ class GenericFluentClient(codegenContext: CodegenContext) : FluentClientCustomiz
// Ignored as otherwise we'd need to pull in all these dev-dependencies.
/// ```rust,ignore
/// use aws_endpoint::AwsEndpointStage;
/// use aws_http::auth::CredentialsStage;
/// use aws_http::recursion_detection::RecursionDetectionStage;
/// use aws_http::user_agent::UserAgentStage;
/// use aws_sig_auth::middleware::SigV4SigningStage;
/// use aws_sig_auth::signer::SigV4Signer;
/// use aws_smithy_http_tower::map_request::MapRequestLayer;
/// use tower::layer::util::Stack;
/// use aws_smithy_client::retry::Config as RetryConfig;
/// use aws_smithy_http_tower::map_request::{AsyncMapRequestLayer, MapRequestLayer};
/// use std::fmt::Debug;
/// use tower::layer::util::{Identity, Stack};
/// use tower::ServiceBuilder;
///
/// type AwsMiddlewareStack =
/// Stack<MapRequestLayer<SigV4SigningStage>,
/// Stack<MapRequestLayer<UserAgentStage>,
/// MapRequestLayer<AwsEndpointStage>>>,
/// type AwsMiddlewareStack = Stack<
/// MapRequestLayer<RecursionDetectionStage>,
/// Stack<
/// MapRequestLayer<SigV4SigningStage>,
/// Stack<
/// AsyncMapRequestLayer<CredentialsStage>,
/// Stack<
/// MapRequestLayer<UserAgentStage>,
/// Stack<MapRequestLayer<AwsEndpointStage>, Identity>,
/// >,
/// >,
/// >,
/// >;
///
/// ##[derive(Debug, Default)]
/// /// AWS Middleware Stack
/// ///
/// /// This implements the middleware stack for this service. It will:
/// /// 1. Load credentials asynchronously into the property bag
/// /// 2. Sign the request with SigV4
/// /// 3. Resolve an Endpoint for the request
/// /// 4. Add a user agent to the request
/// ##[derive(Debug, Default, Clone)]
/// ##[non_exhaustive]
/// pub struct AwsMiddleware;
/// impl<S> tower::Layer<S> for AwsMiddleware {
/// type Service = <AwsMiddlewareStack as tower::Layer<S>>::Service;
///
/// fn layer(&self, inner: S) -> Self::Service {
/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new())); _signer: MapRequestLaye
/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage); _endpoint_resolver: MapRequestLayer<Aw
/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new()); _user_agent: MapRequestLayer<UserAgentSt
/// impl AwsMiddleware {
/// /// Create a new `AwsMiddleware` stack
/// ///
/// /// Note: `AwsMiddleware` holds no state.
/// pub fn new() -> Self {
/// AwsMiddleware::default()
/// }
/// }
///
/// // define the middleware stack in a non-generic location to reduce code bloat.
/// fn base() -> ServiceBuilder<AwsMiddlewareStack> {
/// let credential_provider = AsyncMapRequestLayer::for_mapper(CredentialsStage::new());
/// let signer = MapRequestLayer::for_mapper(SigV4SigningStage::new(SigV4Signer::new()));
/// let endpoint_resolver = MapRequestLayer::for_mapper(AwsEndpointStage);
/// let user_agent = MapRequestLayer::for_mapper(UserAgentStage::new());
/// let recursion_detection = MapRequestLayer::for_mapper(RecursionDetectionStage::new());
/// // These layers can be considered as occurring in order, that is:
/// // 1. Resolve an endpoint
/// // 2. Add a user agent
/// // 3. Sign
/// // (4. Dispatch over the wire)
/// ServiceBuilder::new() _ServiceBuilder<Identity>
/// .layer(endpoint_resolver) _ServiceBuilder<Stack<MapRequestLayer<_>, _>>
/// .layer(user_agent) _ServiceBuilder<Stack<MapRequestLayer<_>, _>>
/// .layer(signer) _ServiceBuilder<Stack<MapRequestLayer<_>, _>>
/// .service(inner)
/// // 3. Acquire credentials
/// // 4. Sign with credentials
/// // (5. Dispatch over the wire)
/// ServiceBuilder::new()
/// .layer(endpoint_resolver)
/// .layer(user_agent)
/// .layer(credential_provider)
/// .layer(signer)
/// .layer(recursion_detection)
/// }
///
/// impl<S> tower::Layer<S> for AwsMiddleware {
/// type Service = <AwsMiddlewareStack as tower::Layer<S>>::Service;
///
/// fn layer(&self, inner: S) -> Self::Service {
/// base().service(inner)
/// }
/// }
/// ```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment