pub struct Data<T: Send + Sync + 'static>(pub Arc<T>);Expand description
The Data extractor
Tuple Fields§
§0: Arc<T>Implementations§
Trait Implementations§
Source§impl<T: Send + Sync + 'static> FromRequest for Data<T>
impl<T: Send + Sync + 'static> FromRequest for Data<T>
Source§type Error = ExtractionError
type Error = ExtractionError
The error that can happen when extracting data
Source§type Future = Ready<Result<Data<T>, <Data<T> as FromRequest>::Error>>
type Future = Ready<Result<Data<T>, <Data<T> as FromRequest>::Error>>
The future that will be used to extract the data
Source§fn from_request(req: &HttpRequest, _: &mut HttpPayload) -> Self::Future
fn from_request(req: &HttpRequest, _: &mut HttpPayload) -> Self::Future
Extracts a value of type
Self from the request. The request contains the request body at the moment but that might change in the futureSource§fn extract(req: &HttpRequest) -> Self::Future
fn extract(req: &HttpRequest) -> Self::Future
Extracts a value of type
Self from the requestAuto Trait Implementations§
impl<T> Freeze for Data<T>
impl<T> RefUnwindSafe for Data<T>where
T: RefUnwindSafe,
impl<T> Send for Data<T>
impl<T> Sync for Data<T>
impl<T> Unpin for Data<T>
impl<T> UnwindSafe for Data<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more