Struct rustiful::JsonApiData
[−]
[src]
pub struct JsonApiData<T> { pub id: Option<String>, pub lower_case_type: String, pub attributes: T, }
Fields
id: Option<String>
lower_case_type: String
attributes: T
Methods
impl<T> JsonApiData<T>
[src]
fn new<Id: Into<String>, Type: Into<String>>(
id: Option<Id>,
lower_case_type: Type,
attrs: T
) -> JsonApiData<T>
id: Option<Id>,
lower_case_type: Type,
attrs: T
) -> JsonApiData<T>
fn has_id(&self) -> bool
Check if there is an id present.
Trait Implementations
impl<T: Debug> Debug for JsonApiData<T>
[src]
impl<T: Clone> Clone for JsonApiData<T>
[src]
fn clone(&self) -> JsonApiData<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: PartialEq> PartialEq for JsonApiData<T>
[src]
fn eq(&self, __arg_0: &JsonApiData<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &JsonApiData<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for JsonApiData<T>
[src]
impl<'a, T> From<(T, &'a JsonApiParams<T::FilterField, T::SortField>)> for JsonApiData<T::Attrs> where
T: ToJson + JsonApiResource,
T::Attrs: From<(T, &'a JsonApiParams<T::FilterField, T::SortField>)>,
[src]
T: ToJson + JsonApiResource,
T::Attrs: From<(T, &'a JsonApiParams<T::FilterField, T::SortField>)>,
Converts a (T, T::Params)
to a JsonApiData<T>
.
fn from(
(model, params): (T, &'a JsonApiParams<T::FilterField, T::SortField>)
) -> Self
(model, params): (T, &'a JsonApiParams<T::FilterField, T::SortField>)
) -> Self
Performs the conversion.