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>>, }
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>>
The semver of the JSON:API
specs
links: Option<CibouletteBodyLink<'request>>
Links to the current object/relationship
data: CibouletteBodyData<'request, I, B>
The data of the request/response. Cannot be set with errors
.
errors: Option<CibouletteErrorObj<'request>>
The error object of the response. Cannot be set with data
.
meta: Option<Value>
The meta object.
included: Vec<CibouletteResource<'request, B, I>>
The included objects. Cannot be set without data
Implementations
impl<'request, I, B> CibouletteBody<'request, I, B>
[src]
impl<'request, I, B> CibouletteBody<'request, I, B>
[src]pub fn jsonapi(&self) -> &Option<CibouletteJsonApiVersion<'request>>
[src]
The semver of the JSON:API
specs
pub fn links(&self) -> &Option<CibouletteBodyLink<'request>>
[src]
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]
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
pub fn links_mut(&mut self) -> &mut Option<CibouletteBodyLink<'request>>
[src]
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]
impl<'request, I, B> CibouletteBody<'request, I, B>
[src]impl<'request, B> CibouletteBody<'request, CibouletteResourceIdentifierPermissive<'request>, B>
[src]
impl<'request, B> CibouletteBody<'request, CibouletteResourceIdentifierPermissive<'request>, B>
[src]pub fn get_main_type(
&self,
bag: &CibouletteStore
) -> Option<Arc<CibouletteResourceType>>
[src]
&self,
bag: &CibouletteStore
) -> Option<Arc<CibouletteResourceType>>
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]
impl<'request, I: Clone, B: Clone> Clone for CibouletteBody<'request, I, B>
[src]fn clone(&self) -> CibouletteBody<'request, I, B>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'request, I: Debug, B: Debug> Debug for CibouletteBody<'request, I, B>
[src]
impl<'request, I: Debug, B: Debug> Debug for CibouletteBody<'request, I, B>
[src]impl<'request, I, B> Default for CibouletteBody<'request, I, B> where
B: Default,
[src]
impl<'request, I, B> Default for CibouletteBody<'request, I, B> where
B: Default,
[src]Auto Trait Implementations
impl<'request, I, B> RefUnwindSafe for CibouletteBody<'request, I, B> where
B: RefUnwindSafe,
I: RefUnwindSafe,
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> 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> 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> 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,
impl<'request, I, B> UnwindSafe for CibouletteBody<'request, I, B> where
B: UnwindSafe,
I: UnwindSafe,