Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve service documentation #2020

Merged
merged 12 commits into from
Nov 25, 2022
5 changes: 5 additions & 0 deletions rust-runtime/aws-smithy-http-server/src/plugin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
* SPDX-License-Identifier: Apache-2.0
*/

//! The plugin system allows for parameterized modification of [`Operation`]s during the build procedure.
hlbarber marked this conversation as resolved.
Show resolved Hide resolved
//!
//! The system centers around the [`Plugin`] trait. In addition, this module provides helpers for composing and
//! combining [`Plugin`]s.

mod closure;
mod filter;
mod identity;
Expand Down
4 changes: 2 additions & 2 deletions rust-runtime/aws-smithy-http-server/src/request/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ impl<B> RequestParts<B> {
}
}

/// Provides a protocol aware extraction from a [`Request`]. This borrows the
/// [`Parts`], in contrast to [`FromRequest`].
// NOTE: We cannot reference `FromRequest` here, as a point of contrast, as it's `doc(hidden)`.
/// Provides a protocol aware extraction from a requests [`Parts`].
pub trait FromParts<Protocol>: Sized {
type Rejection: IntoResponse<Protocol>;

Expand Down
5 changes: 4 additions & 1 deletion rust-runtime/aws-smithy-http-server/src/routing/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ use tower::{
Service, ServiceExt,
};

/// How routes are stored inside a [`Router`](super::Router).
/// A HTTP [`Service`] representing a single route.
///
/// The construction of [`Route`] from a named HTTP [`Service`] S, erases the type of `S`.
hlbarber marked this conversation as resolved.
Show resolved Hide resolved
pub struct Route<B = Body> {
service: BoxCloneService<Request<B>, Response<BoxBody>, Infallible>,
}

impl<B> Route<B> {
/// Constructs a new [`Route`] from any well-formed HTTP service which is cloneable.
hlbarber marked this conversation as resolved.
Show resolved Hide resolved
pub fn new<T>(svc: T) -> Self
where
T: Service<Request<B>, Response = Response<BoxBody>, Error = Infallible> + Clone + Send + 'static,
Expand Down