Struct ciboulette::CibouletteBody[][src]

pub struct CibouletteBody<'request, I, B> {
    pub jsonapi: Option<CibouletteJsonApiVersion<'request>>,
    pub links: Option<CibouletteBodyLink<'request>>,
    pub data: CibouletteBodyData<'request, I, B>,
    pub errors: Option<CibouletteErrorObj<'request>>,
    pub meta: Option<Value>,
    pub included: Vec<CibouletteResource<'request, B, I>>,
}
Expand description

A json:api document object

This struct hold the top level document of a request or a response

Use CibouletteBodyBuilder to be build.

Fields

jsonapi: Option<CibouletteJsonApiVersion<'request>>
Expand description

The semver of the JSON:API specs

links: Option<CibouletteBodyLink<'request>>
Expand description

Links to the current object/relationship

data: CibouletteBodyData<'request, I, B>
Expand description

The data of the request/response. Cannot be set with errors.

errors: Option<CibouletteErrorObj<'request>>
Expand description

The error object of the response. Cannot be set with data.

meta: Option<Value>
Expand description

The meta object.

included: Vec<CibouletteResource<'request, B, I>>
Expand description

The included objects. Cannot be set without data

Implementations

impl<'request, I, B> CibouletteBody<'request, I, B>[src]

pub fn jsonapi(&self) -> &Option<CibouletteJsonApiVersion<'request>>[src]

The semver of the JSON:API specs

Links to the current object/relationship

pub fn data(&self) -> &CibouletteBodyData<'request, I, B>[src]

The data of the request/response. Cannot be set with errors.

pub fn errors(&self) -> &Option<CibouletteErrorObj<'request>>[src]

The error object of the response. Cannot be set with data.

pub fn meta(&self) -> &Option<Value>[src]

The meta object.

pub fn included(&self) -> &Vec<CibouletteResource<'request, B, I>>[src]

The included objects. Cannot be set without data

impl<'request, I, B> CibouletteBody<'request, I, B>[src]

pub fn jsonapi_mut(&mut self) -> &mut Option<CibouletteJsonApiVersion<'request>>[src]

The semver of the JSON:API specs

Links to the current object/relationship

pub fn data_mut(&mut self) -> &mut CibouletteBodyData<'request, I, B>[src]

The data of the request/response. Cannot be set with errors.

pub fn errors_mut(&mut self) -> &mut Option<CibouletteErrorObj<'request>>[src]

The error object of the response. Cannot be set with data.

pub fn meta_mut(&mut self) -> &mut Option<Value>[src]

The meta object.

pub fn included_mut(&mut self) -> &mut Vec<CibouletteResource<'request, B, I>>[src]

The included objects. Cannot be set without data

impl<'request, I, B> CibouletteBody<'request, I, B>[src]

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

Check if the request is a compound document

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

Check if the request has data

impl<'request, B> CibouletteBody<'request, CibouletteResourceIdentifierPermissive<'request>, B>[src]

pub fn get_main_type(
    &self,
    bag: &CibouletteStore
) -> Option<Arc<CibouletteResourceType>>
[src]

Get the main type of the request If it’s a single document request, the type of the document is used. If it’s a compound document request and all the document are the same type, then this type is used. Else None is returned

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

Check if the request has all its id set (not always the case in creating requests)

true if there is no data

Trait Implementations

impl<'request, I: Clone, B: Clone> Clone for CibouletteBody<'request, I, B>[src]

fn clone(&self) -> CibouletteBody<'request, I, B>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'request, I: Debug, B: Debug> Debug for CibouletteBody<'request, I, B>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'request, I, B> Default for CibouletteBody<'request, I, B> where
    B: Default
[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<'request, I, B> Serialize for CibouletteBody<'request, I, B> where
    I: Serialize,
    B: Serialize
[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

impl<'request, I, B> RefUnwindSafe for CibouletteBody<'request, I, B> where
    B: RefUnwindSafe,
    I: RefUnwindSafe

impl<'request, I, B> Send for CibouletteBody<'request, I, B> where
    B: Send,
    I: Send

impl<'request, I, B> Sync for CibouletteBody<'request, I, B> where
    B: Sync,
    I: Sync

impl<'request, I, B> Unpin for CibouletteBody<'request, I, B> where
    B: Unpin,
    I: Unpin

impl<'request, I, B> UnwindSafe for CibouletteBody<'request, I, B> where
    B: UnwindSafe,
    I: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.