pub struct DispositionSet<Set: KindSet> { /* private fields */ }Expand description
A disposition for every declared kind of one set, in declaration order.
The rows are private and the only public constructor checks every name and the complete row count against KindSet::NAMES, so an omitted, doubled, foreign, or reordered seat cannot become this value and cannot be seated beside an expansion.
Implementations§
Source§impl<Set: KindSet> DispositionSet<Set>
impl<Set: KindSet> DispositionSet<Set>
Sourcepub fn complete(record: Set::Dispositions) -> Result<Self, DispositionSetError>
pub fn complete(record: Set::Dispositions) -> Result<Self, DispositionSetError>
Check one set’s disposition record and seal it as complete.
§Errors
Returns DispositionSetError::CountMismatch when the record surrenders fewer or more dispositions than KindSet::NAMES declares.
Returns DispositionSetError::KindMismatch when a surrendered row names a kind other than the kind declared at that position.
Nothing is truncated, padded, or inferred: silence remains unable to enter an account.
Sourcepub const fn len(&self) -> usize
pub const fn len(&self) -> usize
The number of disposition rows, equal to this set’s declared-name count by construction.
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Whether this complete set has no declared kinds and therefore no disposition rows.
Sourcepub fn iter(
&self,
) -> impl ExactSizeIterator<Item = (&'static str, &Disposition)>
pub fn iter( &self, ) -> impl ExactSizeIterator<Item = (&'static str, &Disposition)>
Every declared kind name paired with its disposition, in declaration order.
Trait Implementations§
Source§impl<Set: Clone + KindSet> Clone for DispositionSet<Set>
impl<Set: Clone + KindSet> Clone for DispositionSet<Set>
Source§fn clone(&self) -> DispositionSet<Set>
fn clone(&self) -> DispositionSet<Set>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more