pub struct SchemaOperation(/* private fields */);Expand description
One validated schema transition with an exact offline inverse.
Implementations§
Source§impl SchemaOperation
impl SchemaOperation
Sourcepub fn define(facts: Vec<SchemaFact>) -> Result<Self, Diagnostic>
pub fn define(facts: Vec<SchemaFact>) -> Result<Self, Diagnostic>
Define a non-empty fact group, canonicalized into fact-identity order.
Sourcepub fn redefine(
expected: SchemaFact,
replacement: SchemaFact,
) -> Result<Self, Diagnostic>
pub fn redefine( expected: SchemaFact, replacement: SchemaFact, ) -> Result<Self, Diagnostic>
Redefine an existing fact without changing its stable identity.
Sourcepub const fn undefine(fact: SchemaFact) -> Self
pub const fn undefine(fact: SchemaFact) -> Self
Undefine one exact fact.
Sourcepub const fn kind(&self) -> SchemaOperationKind
pub const fn kind(&self) -> SchemaOperationKind
Return the operation discriminator.
Sourcepub fn defined_facts(&self) -> Option<&[SchemaFact]>
pub fn defined_facts(&self) -> Option<&[SchemaFact]>
Return defined facts when this is a define operation.
Sourcepub fn expected_fact(&self) -> Option<&SchemaFact>
pub fn expected_fact(&self) -> Option<&SchemaFact>
Return the expected current fact when this is a redefinition.
Sourcepub fn replacement_fact(&self) -> Option<&SchemaFact>
pub fn replacement_fact(&self) -> Option<&SchemaFact>
Return the replacement fact when this is a redefinition.
Sourcepub const fn undefined_fact(&self) -> Option<&SchemaFact>
pub const fn undefined_fact(&self) -> Option<&SchemaFact>
Return the exact removed fact when this is an undefinition.
Sourcepub fn affected_ids(&self) -> Vec<SchemaFactId>
pub fn affected_ids(&self) -> Vec<SchemaFactId>
Return all affected identities in canonical order for this operation.
Trait Implementations§
Source§impl Clone for SchemaOperation
impl Clone for SchemaOperation
Source§impl Debug for SchemaOperation
impl Debug for SchemaOperation
impl Eq for SchemaOperation
Source§impl PartialEq for SchemaOperation
impl PartialEq for SchemaOperation
Source§impl Serialize for SchemaOperation
impl Serialize for SchemaOperation
impl StructuralPartialEq for SchemaOperation
Auto Trait Implementations§
impl Freeze for SchemaOperation
impl RefUnwindSafe for SchemaOperation
impl Send for SchemaOperation
impl Sync for SchemaOperation
impl Unpin for SchemaOperation
impl UnsafeUnpin for SchemaOperation
impl UnwindSafe for SchemaOperation
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