Struct aws_smithy_http_server::operation::Operation
source · pub struct Operation<S, L = Identity> {
pub inner: S,
pub layer: L,
}Expand description
A Smithy operation, represented by a Service S and a Layer L.
The L is held and applied lazily during Upgradable::upgrade.
Fields§
§inner: SThe inner Service representing the logic of the operation.
layer: LImplementations§
source§impl<S, L> Operation<S, L>
impl<S, L> Operation<S, L>
sourcepub fn layer<NewL>(self, layer: NewL) -> Operation<S, Stack<L, NewL>>
pub fn layer<NewL>(self, layer: NewL) -> Operation<S, Stack<L, NewL>>
Applies a Layer to the operation after it has been upgraded via Operation::upgrade.
source§impl<Op, S, PollError> Operation<Normalize<Op, S, PollError>>
impl<Op, S, PollError> Operation<Normalize<Op, S, PollError>>
sourcepub fn from_service<Exts>(inner: S) -> Selfwhere
Op: OperationShape,
S: OperationService<Op, Exts, PollError>,
pub fn from_service<Exts>(inner: S) -> Selfwhere Op: OperationShape, S: OperationService<Op, Exts, PollError>,
source§impl<Op, H> Operation<IntoService<Op, H>>
impl<Op, H> Operation<IntoService<Op, H>>
sourcepub fn from_handler<Exts>(handler: H) -> Selfwhere
Op: OperationShape,
H: Handler<Op, Exts>,
pub fn from_handler<Exts>(handler: H) -> Selfwhere Op: OperationShape, H: Handler<Op, Exts>,
Trait Implementations§
source§impl<P, Op, Exts, B, Pl, S, L, PollError> Upgradable<P, Op, Exts, B, Pl> for Operation<S, L>where
Op: OperationShape,
Op::Input: FromRequest<P, B>,
Op::Output: IntoResponse<P>,
Op::Error: IntoResponse<P>,
Exts: FromParts<P>,
Pl::Service: Service<(Op::Input, Exts), Response = Op::Output, Error = OperationError<Op::Error, PollError>> + Clone,
Pl: Plugin<P, Op, S, L>,
Pl::Layer: Layer<Upgrade<P, Op, Exts, Pl::Service>>,
<<Pl as Plugin<P, Op, S, L>>::Layer as Layer<Upgrade<P, Op, Exts, <Pl as Plugin<P, Op, S, L>>::Service>>>::Service: Service<Request<B>, Response = Response<BoxBody>, Error = Infallible> + Clone + Send + 'static,
<<<Pl as Plugin<P, Op, S, L>>::Layer as Layer<Upgrade<P, Op, Exts, <Pl as Plugin<P, Op, S, L>>::Service>>>::Service as Service<Request<B>>>::Future: Send + 'static,
impl<P, Op, Exts, B, Pl, S, L, PollError> Upgradable<P, Op, Exts, B, Pl> for Operation<S, L>where Op: OperationShape, Op::Input: FromRequest<P, B>, Op::Output: IntoResponse<P>, Op::Error: IntoResponse<P>, Exts: FromParts<P>, Pl::Service: Service<(Op::Input, Exts), Response = Op::Output, Error = OperationError<Op::Error, PollError>> + Clone, Pl: Plugin<P, Op, S, L>, Pl::Layer: Layer<Upgrade<P, Op, Exts, Pl::Service>>, <<Pl as Plugin<P, Op, S, L>>::Layer as Layer<Upgrade<P, Op, Exts, <Pl as Plugin<P, Op, S, L>>::Service>>>::Service: Service<Request<B>, Response = Response<BoxBody>, Error = Infallible> + Clone + Send + 'static, <<<Pl as Plugin<P, Op, S, L>>::Layer as Layer<Upgrade<P, Op, Exts, <Pl as Plugin<P, Op, S, L>>::Service>>>::Service as Service<Request<B>>>::Future: Send + 'static,
source§fn upgrade(self, plugin: &Pl) -> Route<B>
fn upgrade(self, plugin: &Pl) -> Route<B>
Takes the Operation<S, L>, applies Plugin, then applies UpgradeLayer to
the modified S, then finally applies the modified L.
The composition is made explicit in the method constraints and return type.
Auto Trait Implementations§
impl<S, L> RefUnwindSafe for Operation<S, L>where L: RefUnwindSafe, S: RefUnwindSafe,
impl<S, L> Send for Operation<S, L>where L: Send, S: Send,
impl<S, L> Sync for Operation<S, L>where L: Sync, S: Sync,
impl<S, L> Unpin for Operation<S, L>where L: Unpin, S: Unpin,
impl<S, L> UnwindSafe for Operation<S, L>where L: UnwindSafe, S: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more