pub struct Typed<M, Input, DecodeCodec, Inner> { /* private fields */ }Expand description
Handler produced by typed (or Typed::over for a non-decoding input kind). Override
the decode-failure policy with Typed::on_decode_failure.
Implementations§
Source§impl<M, Input, DecodeCodec, Inner> Typed<M, Input, DecodeCodec, Inner>
impl<M, Input, DecodeCodec, Inner> Typed<M, Input, DecodeCodec, Inner>
Sourcepub fn over(codec: DecodeCodec, inner: Inner) -> Selfwhere
Input: DecodeWith<DecodeCodec>,
pub fn over(codec: DecodeCodec, inner: Inner) -> Selfwhere
Input: DecodeWith<DecodeCodec>,
Builds the adapter for any input kind: Decoded<T> decodes with codec,
RawBytes ignores it (pass ()) and lends the payload itself.
Sourcepub fn on_decode_failure(self, decode: FailurePolicy) -> Self
pub fn on_decode_failure(self, decode: FailurePolicy) -> Self
Sets the FailurePolicy applied when the codec fails to decode an incoming payload. The
default is FailurePolicy::Drop.
Trait Implementations§
Source§impl<M, Input, DecodeCodec, Inner, Cx, St> Handler<M, Cx, St> for Typed<M, Input, DecodeCodec, Inner>where
M: IncomingMessage,
Input: DecodeWith<DecodeCodec>,
DecodeCodec: Send + Sync,
Cx: Send,
St: Send + Sync,
Inner: Handler<Input::Target, Cx, St>,
impl<M, Input, DecodeCodec, Inner, Cx, St> Handler<M, Cx, St> for Typed<M, Input, DecodeCodec, Inner>where
M: IncomingMessage,
Input: DecodeWith<DecodeCodec>,
DecodeCodec: Send + Sync,
Cx: Send,
St: Send + Sync,
Inner: Handler<Input::Target, Cx, St>,
Auto Trait Implementations§
impl<M, Input, DecodeCodec, Inner> Freeze for Typed<M, Input, DecodeCodec, Inner>
impl<M, Input, DecodeCodec, Inner> RefUnwindSafe for Typed<M, Input, DecodeCodec, Inner>where
DecodeCodec: RefUnwindSafe,
Inner: RefUnwindSafe,
impl<M, Input, DecodeCodec, Inner> Send for Typed<M, Input, DecodeCodec, Inner>
impl<M, Input, DecodeCodec, Inner> Sync for Typed<M, Input, DecodeCodec, Inner>
impl<M, Input, DecodeCodec, Inner> Unpin for Typed<M, Input, DecodeCodec, Inner>
impl<M, Input, DecodeCodec, Inner> UnsafeUnpin for Typed<M, Input, DecodeCodec, Inner>where
DecodeCodec: UnsafeUnpin,
Inner: UnsafeUnpin,
impl<M, Input, DecodeCodec, Inner> UnwindSafe for Typed<M, Input, DecodeCodec, Inner>where
DecodeCodec: UnwindSafe,
Inner: 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