Trait ReqToConnID

pub trait ReqToConnID<Request>:
    Sized
    + Clone
    + Send
    + Sync
    + 'static {
    type ID: ConnID;

    // Required method
    fn id(
        &self,
        ctx: &Context,
        request: &Request,
    ) -> Result<Self::ID, OpaqueError>;
}
Expand description

ReqToConnID is used to convert a Request to a connection ID. These IDs are not unique and multiple connections can have the same ID. IDs are used to filter which connections can be used for a specific Request in a way that is independent of what a Request is.

Required Associated Types§

type ID: ConnID

Required Methods§

fn id(&self, ctx: &Context, request: &Request) -> Result<Self::ID, OpaqueError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl<Body> ReqToConnID<Request<Body>> for BasicHttpConnIdentifier

§

impl<Request, ID, F> ReqToConnID<Request> for F
where F: Fn(&Context, &Request) -> Result<ID, OpaqueError> + Clone + Send + Sync + 'static, ID: ConnID,

§

type ID = ID