pub struct EntityFragment { /* private fields */ }Expand description
Store-free logical entity definition.
Implementations§
Source§impl EntityFragment
impl EntityFragment
Sourcepub fn try_new(
name: SchemaName,
version: DeclaredEntityVersion,
fields: Vec<FieldFragment>,
primary_key: Vec<FieldSourceKey>,
indexes: Vec<IndexFragment>,
relations: Vec<RelationFragment>,
constraints: Vec<ConstraintFragment>,
) -> Result<EntityFragment, SchemaContractError>
pub fn try_new( name: SchemaName, version: DeclaredEntityVersion, fields: Vec<FieldFragment>, primary_key: Vec<FieldSourceKey>, indexes: Vec<IndexFragment>, relations: Vec<RelationFragment>, constraints: Vec<ConstraintFragment>, ) -> Result<EntityFragment, SchemaContractError>
Construct and canonicalize one entity definition.
§Errors
Returns a typed contract error for collection overflow, duplicate source keys, malformed policy, expression, or primary-key references.
Sourcepub const fn source_key(&self) -> &EntitySourceKey
pub const fn source_key(&self) -> &EntitySourceKey
Borrow the typed proposal key derived from the current entity name.
Sourcepub const fn name(&self) -> &SchemaName
pub const fn name(&self) -> &SchemaName
Borrow the current entity name.
Sourcepub const fn version(&self) -> DeclaredEntityVersion
pub const fn version(&self) -> DeclaredEntityVersion
Return the application-declared current entity version.
Sourcepub fn fields(&self) -> &[FieldFragment]
pub fn fields(&self) -> &[FieldFragment]
Borrow canonical field definitions.
Sourcepub fn primary_key(&self) -> &[FieldSourceKey]
pub fn primary_key(&self) -> &[FieldSourceKey]
Borrow ordered primary-key fields.
Sourcepub fn indexes(&self) -> &[IndexFragment]
pub fn indexes(&self) -> &[IndexFragment]
Borrow canonical secondary-index definitions.
Sourcepub fn relations(&self) -> &[RelationFragment]
pub fn relations(&self) -> &[RelationFragment]
Borrow canonical relation definitions.
Sourcepub fn constraints(&self) -> &[ConstraintFragment]
pub fn constraints(&self) -> &[ConstraintFragment]
Borrow canonical source constraint definitions.
Trait Implementations§
Source§impl Clone for EntityFragment
impl Clone for EntityFragment
Source§fn clone(&self) -> EntityFragment
fn clone(&self) -> EntityFragment
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 EntityFragment
impl Debug for EntityFragment
impl Eq for EntityFragment
Source§impl PartialEq for EntityFragment
impl PartialEq for EntityFragment
impl StructuralPartialEq for EntityFragment
Auto Trait Implementations§
impl Freeze for EntityFragment
impl RefUnwindSafe for EntityFragment
impl Send for EntityFragment
impl Sync for EntityFragment
impl Unpin for EntityFragment
impl UnsafeUnpin for EntityFragment
impl UnwindSafe for EntityFragment
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.