pub struct Query<QueryType: DeserializeOwned + JsonSchema + Send + Sync> { /* private fields */ }Expand description
Query<QueryType> is an extractor used to deserialize an instance of
QueryType from an HTTP request’s query string. QueryType may be any
struct of yours that implements serde::Deserialize and
schemars::JsonSchema.
See the top-level crate documentation for more information.
Implementations§
Source§impl<QueryType: DeserializeOwned + JsonSchema + Send + Sync> Query<QueryType>
impl<QueryType: DeserializeOwned + JsonSchema + Send + Sync> Query<QueryType>
pub fn into_inner(self) -> QueryType
Sourcepub fn map<T, F>(self, f: F) -> Query<T>
pub fn map<T, F>(self, f: F) -> Query<T>
Convert this Query into one with a different type parameter; this
may be useful when multiple, related endpoints take query parameters
that are similar and convertible into a common type.
Sourcepub fn try_map<T, E, F>(self, f: F) -> Result<Query<T>, E>
pub fn try_map<T, E, F>(self, f: F) -> Result<Query<T>, E>
Similar to Query::map but with support for fallibility.
Trait Implementations§
Source§impl<QueryType: Debug + DeserializeOwned + JsonSchema + Send + Sync> Debug for Query<QueryType>
impl<QueryType: Debug + DeserializeOwned + JsonSchema + Send + Sync> Debug for Query<QueryType>
Source§impl<QueryType: DeserializeOwned + JsonSchema + Send + Sync> From<QueryType> for Query<QueryType>
impl<QueryType: DeserializeOwned + JsonSchema + Send + Sync> From<QueryType> for Query<QueryType>
Source§fn from_request<'life0, 'async_trait, Context>(
rqctx: &'life0 RequestContext<Context>,
) -> Pin<Box<dyn Future<Output = Result<Query<QueryType>, HttpError>> + Send + 'async_trait>>where
Context: 'async_trait + ServerContext,
'life0: 'async_trait,
fn from_request<'life0, 'async_trait, Context>(
rqctx: &'life0 RequestContext<Context>,
) -> Pin<Box<dyn Future<Output = Result<Query<QueryType>, HttpError>> + Send + 'async_trait>>where
Context: 'async_trait + ServerContext,
'life0: 'async_trait,
Construct an instance of this type from a
RequestContext.fn metadata(_body_content_type: ApiEndpointBodyContentType) -> ExtractorMetadata
Auto Trait Implementations§
impl<QueryType> Freeze for Query<QueryType>where
QueryType: Freeze,
impl<QueryType> RefUnwindSafe for Query<QueryType>where
QueryType: RefUnwindSafe,
impl<QueryType> Send for Query<QueryType>
impl<QueryType> Sync for Query<QueryType>
impl<QueryType> Unpin for Query<QueryType>where
QueryType: Unpin,
impl<QueryType> UnwindSafe for Query<QueryType>where
QueryType: 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<S> ExclusiveExtractor for Swhere
S: SharedExtractor,
impl<S> ExclusiveExtractor for Swhere
S: SharedExtractor,
Source§fn from_request<'life0, 'async_trait, Context>(
rqctx: &'life0 RequestContext<Context>,
_request: Request<Body>,
) -> Pin<Box<dyn Future<Output = Result<S, HttpError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Context: 'async_trait + ServerContext,
S: 'async_trait,
fn from_request<'life0, 'async_trait, Context>(
rqctx: &'life0 RequestContext<Context>,
_request: Request<Body>,
) -> Pin<Box<dyn Future<Output = Result<S, HttpError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Context: 'async_trait + ServerContext,
S: 'async_trait,
Construct an instance of this type from a
RequestContext.