Trait TryRefIntoTransportContext
pub trait TryRefIntoTransportContext {
type Error;
// Required method
fn try_ref_into_transport_ctx(
&self,
) -> Result<TransportContext, Self::Error>;
}Available on crate feature
net 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 Extensions and be a ref.
Required Associated Types§
type Error
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) -> Result<TransportContext, Self::Error>
fn try_ref_into_transport_ctx(&self) -> Result<TransportContext, Self::Error>
Try to turn the reference to self within the given context into the TransportContext.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".