FromRequest

Trait FromRequest 

Source
pub trait FromRequest<State: Clone + Send + Sync + 'static>: Sized {
    // Required method
    fn from_request(
        req: Request<State>,
    ) -> impl Future<Output = Result<Self, CatBridgeError>> + Send;
}
Available on crate features clients or servers only.
Expand description

Extract any value from a Request, finalizing it.

Kept as our own trait so it can be async like axum.

Required Methods§

Source

fn from_request( req: Request<State>, ) -> impl Future<Output = Result<Self, CatBridgeError>> + Send

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.

Implementations on Foreign Types§

Source§

impl<State: Clone + Send + Sync + 'static> FromRequest<State> for Option<WriteAheadLog>

Available on crate feature servers only.
Source§

async fn from_request(req: Request<State>) -> Result<Self, CatBridgeError>

Available on crate features clients or servers only.

Implementors§

Source§

impl<BodyTy, ErrTy, State: Clone + Send + Sync + 'static> FromRequest<State> for Body<BodyTy>
where BodyTy: TryFrom<Bytes, Error = ErrTy>, ErrTy: Into<Report> + Send + Sync + 'static,

Available on crate feature servers only.
Source§

impl<OuterState: Clone + Send + Sync + 'static, InnerState: FromRef<OuterState> + Clone + Send + Sync + 'static> FromRequest<OuterState> for State<InnerState>

Available on crate feature servers only.
Source§

impl<State: Clone + Send + Sync + 'static> FromRequest<State> for SataConnectionFlags

Available on crate feature servers only.
Source§

impl<State: Clone + Send + Sync + 'static> FromRequest<State> for RequestID

Source§

impl<State: Clone + Send + Sync + 'static> FromRequest<State> for StreamID

Source§

impl<State: Clone + Send + Sync + 'static> FromRequest<State> for Request<State>

Source§

impl<Ty, State: Clone + Send + Sync + 'static> FromRequest<State> for Extension<Ty>
where Ty: Clone + Send + Sync + 'static,

Available on crate feature servers only.