Trait rama::net::transport::TryRefIntoTransportContext

pub trait TryRefIntoTransportContext<State> {
    type Error;

    // Required method
    fn try_ref_into_transport_ctx(
        &self,
        ctx: &Context<State>,
    ) -> Result<TransportContext, Self::Error>;
}
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§

type Error

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

Required Methods§

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.

Implementors§

§

impl<State> TryRefIntoTransportContext<State> for rama::http::dep::http::request::Parts

§

impl<State> TryRefIntoTransportContext<State> for rama::tcp::client::Parts

§

impl<State> TryRefIntoTransportContext<State> for rama::tcp::client::Request

§

impl<State, Body> TryRefIntoTransportContext<State> for rama::http::dep::http::Request<Body>