pub struct KeyTable {
pub ic_key: IdentityConstraintKey,
pub constraint_name: NameId,
pub kind: IdentityKind,
pub sequences: Vec<KeySequence>,
}Expand description
Collection of key sequences for one constraint activation with duplicate detection.
Fields§
§ic_key: IdentityConstraintKeyArena key identifying which identity constraint produced this table.
constraint_name: NameId§kind: IdentityKind§sequences: Vec<KeySequence>Implementations§
Source§impl KeyTable
impl KeyTable
Sourcepub fn new(
ic_key: IdentityConstraintKey,
constraint_name: NameId,
kind: IdentityKind,
) -> Self
pub fn new( ic_key: IdentityConstraintKey, constraint_name: NameId, kind: IdentityKind, ) -> Self
Create a new empty key table.
Sourcepub fn add_sequence(
&mut self,
seq: KeySequence,
name_table: &NameTable,
element_path: &str,
location: Option<SourceLocation>,
) -> Vec<ValidationError>
pub fn add_sequence( &mut self, seq: KeySequence, name_table: &NameTable, element_path: &str, location: Option<SourceLocation>, ) -> Vec<ValidationError>
Add a key sequence, performing duplicate/completeness checks as appropriate.
- Key: error if incomplete (
cvc-identity-constraint.4.2.1), error if duplicate (cvc-identity-constraint.4.2.2). - Unique: check duplicate only if complete (incomplete sequences are skipped per XSD spec).
- Keyref: just store (deferred to
check_keyref_against).
Sourcepub fn check_keyref_against(
&self,
target: &KeyTable,
name_table: &NameTable,
) -> Vec<ValidationError>
pub fn check_keyref_against( &self, target: &KeyTable, name_table: &NameTable, ) -> Vec<ValidationError>
Check all keyref sequences against a target key/unique table.
Returns cvc-identity-constraint.4.3 errors for unmatched keyrefs.
Auto Trait Implementations§
impl Freeze for KeyTable
impl RefUnwindSafe for KeyTable
impl Send for KeyTable
impl Sync for KeyTable
impl Unpin for KeyTable
impl UnsafeUnpin for KeyTable
impl UnwindSafe for KeyTable
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