Enum arc_reactor::QueryParseError [] [src]

pub enum QueryParseError {
    SerdeError(Error),
    ParseError(ParseError),
    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

#[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": "{serde error}" }' if it failed to deserialize.
  // or '{ "error": "{parse error}" }' if it failed to parse.
}

Variants

Trait Implementations

impl From<QueryParseError> for Response
[src]

[src]

Performs the conversion.

impl Debug for QueryParseError
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations