Enum arc_reactor::JsonError [] [src]

pub enum JsonError {
    None,
    Err(Error),
}

the error returned by Request::json()

From<JsonError> is implemented for Response so you can use the ? to unwrap or return an early response

#[service]
fn UserService(req: Request, res: Response) {
  let User { name } = req.json()?;
  // will return an error response with the  json '{ "error": "Json was empty" }' if JsonError::None
  // or '{ "error": "{serde error}" }' if it failed to deserialize.
}

Variants

Trait Implementations

impl From<JsonError> for Response
[src]

[src]

Performs the conversion.

impl Debug for JsonError
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for JsonError

impl Sync for JsonError