pub struct AllGroupState { /* private fields */ }Expand description
Mutable state during all-group validation
Tracks how many times each particle has been matched (consumed count).
Implementations§
Source§impl AllGroupState
impl AllGroupState
Sourcepub fn new(model: &AllGroupModel) -> Self
pub fn new(model: &AllGroupModel) -> Self
Create a new validation state for an all-group
Sourcepub fn reset(&mut self, model: &AllGroupModel)
pub fn reset(&mut self, model: &AllGroupModel)
Reset the state for a new validation run
Sourcepub fn can_accept(&self, model: &AllGroupModel, index: usize) -> bool
pub fn can_accept(&self, model: &AllGroupModel, index: usize) -> bool
Check if a particle can still accept matches
Sourcepub fn accept(&mut self, model: &AllGroupModel, index: usize) -> bool
pub fn accept(&mut self, model: &AllGroupModel, index: usize) -> bool
Accept a match for the particle at the given index
Returns true if the match was accepted, false if the particle cannot accept any more matches.
Sourcepub fn is_satisfied(&self, model: &AllGroupModel) -> bool
pub fn is_satisfied(&self, model: &AllGroupModel) -> bool
Check if all particles have satisfied their minOccurs constraints
Sourcepub fn has_any_consumed(&self) -> bool
pub fn has_any_consumed(&self) -> bool
Check if any particle has been consumed at all
Sourcepub fn unsatisfied_indices(&self, model: &AllGroupModel) -> Vec<usize>
pub fn unsatisfied_indices(&self, model: &AllGroupModel) -> Vec<usize>
Get indices of particles that have not satisfied their minOccurs
Trait Implementations§
Source§impl Clone for AllGroupState
impl Clone for AllGroupState
Source§fn clone(&self) -> AllGroupState
fn clone(&self) -> AllGroupState
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 moreAuto Trait Implementations§
impl Freeze for AllGroupState
impl RefUnwindSafe for AllGroupState
impl Send for AllGroupState
impl Sync for AllGroupState
impl Unpin for AllGroupState
impl UnsafeUnpin for AllGroupState
impl UnwindSafe for AllGroupState
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