Trait axum::RequestPartsExt
source · pub trait RequestPartsExt: Sealed + Sized {
fn extract<E>(
&mut self
) -> Pin<Box<dyn Future<Output = Result<E, <E as FromRequestParts<()>>::Rejection>> + Send, Global>>
where
E: 'static + FromRequestParts<()>;
fn extract_with_state<E, S, 'a>(
&'a mut self,
state: &'a S
) -> Pin<Box<dyn Future<Output = Result<E, <E as FromRequestParts<S>>::Rejection>> + Send + 'a, Global>>
where
E: 'static + FromRequestParts<S>,
S: Send + Sync;
}
Expand description
Extension trait that adds additional methods to Parts
.
Required Methods§
sourcefn extract<E>(
&mut self
) -> Pin<Box<dyn Future<Output = Result<E, <E as FromRequestParts<()>>::Rejection>> + Send, Global>>where
E: 'static + FromRequestParts<()>,
fn extract<E>(
&mut self
) -> Pin<Box<dyn Future<Output = Result<E, <E as FromRequestParts<()>>::Rejection>> + Send, Global>>where
E: 'static + FromRequestParts<()>,
Apply an extractor to this Parts
.
This is just a convenience for E::from_request_parts(parts, &())
.
sourcefn extract_with_state<E, S, 'a>(
&'a mut self,
state: &'a S
) -> Pin<Box<dyn Future<Output = Result<E, <E as FromRequestParts<S>>::Rejection>> + Send + 'a, Global>>where
E: 'static + FromRequestParts<S>,
S: Send + Sync,
fn extract_with_state<E, S, 'a>(
&'a mut self,
state: &'a S
) -> Pin<Box<dyn Future<Output = Result<E, <E as FromRequestParts<S>>::Rejection>> + Send + 'a, Global>>where
E: 'static + FromRequestParts<S>,
S: Send + Sync,
Apply an extractor that requires some state to this Parts
.
This is just a convenience for E::from_request_parts(parts, state)
.