pub struct Query<T>(pub T);Expand description
Extract query string parameters.
Deserializes query pairs into typed values.
ⓘ
#[derive(Deserialize)]
struct Pagination { page: u32, per_page: u32 }
async fn list(Query(p): Query<Pagination>) -> String {
format!("Page {} ({} per page)", p.page, p.per_page)
}Tuple Fields§
§0: TTrait Implementations§
Source§impl<T> FromRequestParts for Query<T>where
T: DeserializeOwned,
impl<T> FromRequestParts for Query<T>where
T: DeserializeOwned,
Source§fn from_request_parts(req: &Request) -> Result<Self, ExtractionError>
fn from_request_parts(req: &Request) -> Result<Self, ExtractionError>
Attempt to extract from request parts.
Auto Trait Implementations§
impl<T> Freeze for Query<T>where
T: Freeze,
impl<T> RefUnwindSafe for Query<T>where
T: RefUnwindSafe,
impl<T> Send for Query<T>where
T: Send,
impl<T> Sync for Query<T>where
T: Sync,
impl<T> Unpin for Query<T>where
T: Unpin,
impl<T> UnsafeUnpin for Query<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Query<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromRequest for Twhere
T: FromRequestParts,
impl<T> FromRequest for Twhere
T: FromRequestParts,
Source§fn from_request(req: Request) -> Result<T, ExtractionError>
fn from_request(req: Request) -> Result<T, ExtractionError>
Attempt to extract from the request.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).