Enum arc_reactor::core::QueryParseError [−][src]
pub enum QueryParseError { Err(Error), None, }
The error returned by Request::query()
.
From<QueryParseError>
is implemented for Response
so you can use the ?
to unwrap or return an early response
ⓘThis example is not tested
#[service] fn UserService(req: Request, res: Response) { let AccessToken { token } = req.query()?; // will return an error response with the // json '{ "error": "query data was empty" }' if QueryParseError::None // or '{ "error": "{parse error}" }' if it failed to deserialize. }
Variants
Err(Error)
This error occurs when deserialization fails for the query
None
this error occurs when there is no query data in the uri
Trait Implementations
impl From<QueryParseError> for Response
[src]
impl From<QueryParseError> for Response
fn from(error: QueryParseError) -> Response
[src]
fn from(error: QueryParseError) -> Response
Performs the conversion.
impl Debug for QueryParseError
[src]
impl Debug for QueryParseError
Auto Trait Implementations
impl Send for QueryParseError
impl Send for QueryParseError
impl !Sync for QueryParseError
impl !Sync for QueryParseError