pub struct Relationship {
pub data: Option<Linkage>,
pub links: Option<Links>,
}Expand description
A relationship: linkage plus its self/related links.
Fields§
§data: Option<Linkage>§links: Option<Links>Implementations§
Source§impl Relationship
impl Relationship
Sourcepub fn to_one(identifier: ResourceIdentifier) -> Self
pub fn to_one(identifier: ResourceIdentifier) -> Self
A to-one relationship — todo belongs_to user as owner.
Sourcepub fn to_many(identifiers: Vec<ResourceIdentifier>) -> Self
pub fn to_many(identifiers: Vec<ResourceIdentifier>) -> Self
A to-many relationship — user has_many todo.
Sourcepub fn empty_to_one() -> Self
pub fn empty_to_one() -> Self
An empty to-one relationship — an explicit null, distinct from absent.
pub fn with_links(self, links: Links) -> Self
Trait Implementations§
Source§impl Clone for Relationship
impl Clone for Relationship
Source§impl Debug for Relationship
impl Debug for Relationship
Source§impl<'de> Deserialize<'de> for Relationship
impl<'de> Deserialize<'de> for Relationship
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 PartialEq for Relationship
impl PartialEq for Relationship
Source§impl Serialize for Relationship
impl Serialize for Relationship
impl StructuralPartialEq for Relationship
Auto Trait Implementations§
impl Freeze for Relationship
impl RefUnwindSafe for Relationship
impl Send for Relationship
impl Sync for Relationship
impl Unpin for Relationship
impl UnsafeUnpin for Relationship
impl UnwindSafe for Relationship
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