pub enum Data<T: PrimaryData> {
Collection(Vec<T>),
Member(Box<Option<T>>),
}
Expand description
Describes the data of a document or resource linkage.
For more information, check out the top level section of the JSON API specification.
Variants§
Collection(Vec<T>)
A collection of T
. Used for requests that target resource collections.
Member(Box<Option<T>>)
An optional T
. Used for requests that target single resources.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Data<T>where
T: PrimaryData,
impl<'de, T> Deserialize<'de> for Data<T>where
T: PrimaryData,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: PrimaryData> From<T> for Data<T>
impl<T: PrimaryData> From<T> for Data<T>
Source§impl<T: PrimaryData> FromIterator<T> for Data<T>
impl<T: PrimaryData> FromIterator<T> for Data<T>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
Source§impl<T> Serialize for Data<T>where
T: PrimaryData,
impl<T> Serialize for Data<T>where
T: PrimaryData,
impl<T: Eq + PrimaryData> Eq for Data<T>
impl<T: PrimaryData> StructuralPartialEq for Data<T>
Auto Trait Implementations§
impl<T> Freeze for Data<T>
impl<T> RefUnwindSafe for Data<T>where
T: RefUnwindSafe,
impl<T> Send for Data<T>where
T: Send,
impl<T> Sync for Data<T>where
T: Sync,
impl<T> Unpin for Data<T>where
T: Unpin,
impl<T> UnwindSafe for Data<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.