pub struct RelationFragment { /* private fields */ }Expand description
One source-owned relation definition.
Implementations§
Source§impl RelationFragment
impl RelationFragment
Sourcepub fn try_new(
name: SchemaName,
local_fields: Vec<FieldSourceKey>,
target_entity: EntitySourceKey,
target_fields: Vec<FieldSourceKey>,
on_delete: RelationDeleteAction,
) -> Result<RelationFragment, SchemaContractError>
pub fn try_new( name: SchemaName, local_fields: Vec<FieldSourceKey>, target_entity: EntitySourceKey, target_fields: Vec<FieldSourceKey>, on_delete: RelationDeleteAction, ) -> Result<RelationFragment, SchemaContractError>
Construct one relation with ordered source/target components.
§Errors
Returns a typed reference-list error for empty or arity-mismatched components.
Sourcepub const fn source_key(&self) -> &RelationSourceKey
pub const fn source_key(&self) -> &RelationSourceKey
Borrow the typed proposal key derived from the current relation name.
Sourcepub const fn name(&self) -> &SchemaName
pub const fn name(&self) -> &SchemaName
Borrow the current relation name.
Sourcepub fn local_fields(&self) -> &[FieldSourceKey]
pub fn local_fields(&self) -> &[FieldSourceKey]
Borrow ordered source fields.
Sourcepub const fn target_entity(&self) -> &EntitySourceKey
pub const fn target_entity(&self) -> &EntitySourceKey
Borrow the target entity source key.
Sourcepub fn target_fields(&self) -> &[FieldSourceKey]
pub fn target_fields(&self) -> &[FieldSourceKey]
Borrow ordered target fields.
Sourcepub const fn on_delete(&self) -> RelationDeleteAction
pub const fn on_delete(&self) -> RelationDeleteAction
Return the maintained delete action.
Trait Implementations§
Source§impl Clone for RelationFragment
impl Clone for RelationFragment
Source§fn clone(&self) -> RelationFragment
fn clone(&self) -> RelationFragment
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 moreSource§impl Debug for RelationFragment
impl Debug for RelationFragment
impl Eq for RelationFragment
Source§impl PartialEq for RelationFragment
impl PartialEq for RelationFragment
impl StructuralPartialEq for RelationFragment
Auto Trait Implementations§
impl Freeze for RelationFragment
impl RefUnwindSafe for RelationFragment
impl Send for RelationFragment
impl Sync for RelationFragment
impl Unpin for RelationFragment
impl UnsafeUnpin for RelationFragment
impl UnwindSafe for RelationFragment
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§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.