pub struct Relationship {
pub parent_entity: String,
pub child_entity: String,
pub count_field: Option<String>,
pub foreign_key_field: Option<String>,
pub relationship_path: Option<String>,
pub method: String,
}Expand description
Represents a relationship between two entities
Fields§
§parent_entity: StringParent entity name (e.g., “apiary”)
child_entity: StringChild entity name (e.g., “hive”)
count_field: Option<String>Field in parent that indicates count (e.g., “hive_count”)
foreign_key_field: Option<String>Field in child that references parent (e.g., “apiary_id”)
relationship_path: Option<String>API path for the relationship (e.g., “/api/apiaries/{id}/hives”)
method: StringHTTP method for the relationship endpoint
Implementations§
Source§impl Relationship
impl Relationship
Sourcepub fn with_count_field(self, field: String) -> Self
pub fn with_count_field(self, field: String) -> Self
Set the count field
Sourcepub fn with_foreign_key_field(self, field: String) -> Self
pub fn with_foreign_key_field(self, field: String) -> Self
Set the foreign key field
Trait Implementations§
Source§impl Clone for Relationship
impl Clone for Relationship
Source§fn clone(&self) -> Relationship
fn clone(&self) -> Relationship
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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