Trait TryRefIntoTransportContext

Source
pub trait TryRefIntoTransportContext<State> {
    type Error;

    // Required method
    fn try_ref_into_transport_ctx(
        &self,
        ctx: &Context<State>,
    ) -> Result<TransportContext, Self::Error>;
}
Available on crate feature http only.
Expand description

Utility trait to support trait bounds where you wish to turn combined types into a TransportContext, not expressible with Into.

e.g. &Request: Into<TransportContext> would not work if it needs also Context and be a ref.

Required Associated Types§

Source

type Error

The error that can happen when trying to turn the self reference into the TransportContext.

Required Methods§

Source

fn try_ref_into_transport_ctx( &self, ctx: &Context<State>, ) -> Result<TransportContext, Self::Error>

Try to turn the reference to self within the given context into the TransportContext.

Implementations on Foreign Types§

Source§

impl<State> TryRefIntoTransportContext<State> for Parts

Source§

impl<State, Body> TryRefIntoTransportContext<State> for Request<Body>

Implementors§