pub trait RelationshipDef {
// Required methods
fn name(&self) -> &str;
fn target(&self) -> &str;
fn is_to_many(&self) -> bool;
}Expand description
One relationship your resource declares.
Only the arity matters to JSON:API: a to-one relationship serializes as a single linkage object, a to-many as an array. Whatever distinction your data layer draws beyond that — belongs-to versus has-one, join tables — is its business, not the wire format’s.
Rel is a ready-made implementation; write your own only if you already
have a relationship type to borrow.
Required Methods§
Sourcefn is_to_many(&self) -> bool
fn is_to_many(&self) -> bool
Whether the far side holds many resources.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl RelationshipDef for RelationshipSchema
Available on crate feature domain only.
impl RelationshipDef for RelationshipSchema
Available on crate feature
domain only.