[][src]Enum arangors::document::response::DocumentResponse

pub enum DocumentResponse<T> {
    Silent,
    Response {
        header: Header,
        old: Option<T>,
        new: Option<T>,
        _old_rev: Option<String>,
    },
}

Standard Response when having CRUD operation on document

TODO could add more response variant as shown in official doc

200: is returned if the document was found

304: is returned if the “If-None-Match” header is given and the document has the same version

404: is returned if the document or collection was not found

412: is returned if an “If-Match” header is given and the found document has a different version. The response will also contain the found document’s current revision in the Etag header.

Variants

Silent

Silent is when there is empty object returned by the server

Response

Contain data after CRUD

Fields of Response

header: Headerold: Option<T>new: Option<T>_old_rev: Option<String>

Implementations

impl<T> DocumentResponse<T>[src]

Gives extra method on the DocumentResponse to quickly check what the server returns

pub fn is_silent(&self) -> bool[src]

Should be true when the server send back an empty object {}

pub fn has_response(&self) -> bool[src]

Should be true if there is a response from the server

pub fn header(&self) -> Option<&Header>[src]

Return the document header contained inside the response

pub fn old_doc(&self) -> Option<&T>[src]

Return the old document before changes

pub fn new_doc(&self) -> Option<&T>[src]

Return the new document

pub fn old_rev(&self) -> Option<&String>[src]

return the old revision of the document

Trait Implementations

impl<'de, T> Deserialize<'de> for DocumentResponse<T> where
    T: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for DocumentResponse<T> where
    T: RefUnwindSafe

impl<T> Send for DocumentResponse<T> where
    T: Send

impl<T> Sync for DocumentResponse<T> where
    T: Sync

impl<T> Unpin for DocumentResponse<T> where
    T: Unpin

impl<T> UnwindSafe for DocumentResponse<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.