[−][src]Struct japi::ResourceObject
A resource object
Much like the object in the
JSON:API docs with the
notable difference that the type of the object is encoded into the strictly typed
Attributes
genric
Fields
id: String
The object identifier which together with A::kind
must identify
a unique resource
attributes: Option<A>
Attributes representing some of the resource's data
relationships: Option<Relationships>
Describes relationships between this resource and others
links: Option<Links>
Contains links relating to the resource
meta: Option<Meta>
Contains non-standard meta information
Methods
impl<A> ResourceObject<A> where
A: Attributes + Serialize + DeserializeOwned,
[src]
A: Attributes + Serialize + DeserializeOwned,
pub fn new(id: String, attributes: Option<A>) -> Self
[src]
pub fn add_relationship(&mut self, name: String, relationship: Relationship)
[src]
Inserts an entry into the relationship map, creating the map if it does not exist
pub fn add_link(&mut self, name: String, link: Link)
[src]
Inserts an entry into the link map, creating the map if it does not exist
Trait Implementations
impl<A> From<ResourceObject<A>> for GenericObject where
A: Attributes + SerializeTrait + DeserializeOwned,
[src]
A: Attributes + SerializeTrait + DeserializeOwned,
fn from(ro: ResourceObject<A>) -> Self
[src]
impl<'_, A> From<&'_ ResourceObject<A>> for GenericObject where
A: Attributes + SerializeTrait + DeserializeOwned,
[src]
A: Attributes + SerializeTrait + DeserializeOwned,
fn from(ro: &ResourceObject<A>) -> Self
[src]
impl<A> From<ResourceObject<A>> for Identifier where
A: Attributes + SerializeTrait + DeserializeOwned,
[src]
A: Attributes + SerializeTrait + DeserializeOwned,
fn from(ro: ResourceObject<A>) -> Self
[src]
impl<'_, A> From<&'_ ResourceObject<A>> for Identifier where
A: Attributes + SerializeTrait + DeserializeOwned,
[src]
A: Attributes + SerializeTrait + DeserializeOwned,
fn from(ro: &ResourceObject<A>) -> Self
[src]
impl<A: Clone + Attributes + Serialize + DeserializeOwned> Clone for ResourceObject<A>
[src]
fn clone(&self) -> ResourceObject<A>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<A: PartialEq + Attributes + Serialize + DeserializeOwned> PartialEq<ResourceObject<A>> for ResourceObject<A>
[src]
fn eq(&self, other: &ResourceObject<A>) -> bool
[src]
fn ne(&self, other: &ResourceObject<A>) -> bool
[src]
impl<A: Debug + Attributes + Serialize + DeserializeOwned> Debug for ResourceObject<A>
[src]
impl<A> TryFrom<GenericObject> for ResourceObject<A> where
A: Attributes + Serialize + DeserializeOwned,
[src]
A: Attributes + Serialize + DeserializeOwned,
type Error = ObjectConversionError
The type returned in the event of a conversion error.
fn try_from(go: GenericObject) -> Result<Self, Self::Error>
[src]
impl<'_, A> TryFrom<&'_ GenericObject> for ResourceObject<A> where
A: Attributes + Serialize + DeserializeOwned,
[src]
A: Attributes + Serialize + DeserializeOwned,
type Error = ObjectConversionError
The type returned in the event of a conversion error.
fn try_from(go: &GenericObject) -> Result<Self, Self::Error>
[src]
impl<A> TryFrom<Identifier> for ResourceObject<A> where
A: Attributes + Serialize + DeserializeOwned,
[src]
A: Attributes + Serialize + DeserializeOwned,
type Error = ObjectConversionError
The type returned in the event of a conversion error.
fn try_from(id: Identifier) -> Result<Self, Self::Error>
[src]
impl<'_, A> TryFrom<&'_ Identifier> for ResourceObject<A> where
A: Attributes + Serialize + DeserializeOwned,
[src]
A: Attributes + Serialize + DeserializeOwned,
type Error = ObjectConversionError
The type returned in the event of a conversion error.
fn try_from(id: &Identifier) -> Result<Self, Self::Error>
[src]
Auto Trait Implementations
impl<A> Send for ResourceObject<A> where
A: Send,
A: Send,
impl<A> Sync for ResourceObject<A> where
A: Sync,
A: Sync,
impl<A> Unpin for ResourceObject<A> where
A: Unpin,
A: Unpin,
impl<A> UnwindSafe for ResourceObject<A> where
A: UnwindSafe,
A: UnwindSafe,
impl<A> RefUnwindSafe for ResourceObject<A> where
A: RefUnwindSafe,
A: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,