Struct couchdb::Nok [] [src]

pub struct Nok {
    pub error: String,
    pub reason: String,
    // some fields omitted
}

Nok contains the content of an error response from the CouchDB server.

Summary

Remarks

When the CouchDB server responds with a 4xx- or 5xx status code, the response usually has a body containing a JSON object with an “error” string and a “reason” string. For example:

{
  "error": "file_exists",
  "reason": "The database could not be created, the file already exists."
}

The Nok type contains the information from the response body.

extern crate couchdb;
extern crate serde_json;

let nok: couchdb::Nok = serde_json::from_slice(body).unwrap();

assert_eq!(nok.error, "file_exists");
assert_eq!(nok.reason,
           "The database could not be created, the file already exists.");

Compatibility

Nok contains a dummy private member in order to prevent applications from directly constructing a Nok instance. This allows new fields to be added to Nok in future releases without it being a breaking change.

Fields

Trait Implementations

impl Clone for Nok
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Nok
[src]

Formats the value using the given formatter.

impl Default for Nok
[src]

Returns the "default value" for a type. Read more

impl Eq for Nok
[src]

impl Hash for Nok
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Ord for Nok
[src]

This method returns an Ordering between self and other. Read more

impl PartialEq for Nok
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd for Nok
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more