pub struct ValueState {
pub def: ValueDef,
pub index: usize,
/* private fields */
}Expand description
Runtime state for a single value.
Fields§
§def: ValueDefDefinition from template.
index: usizeIndex of this value in the record.
Implementations§
Source§impl ValueState
impl ValueState
Sourcepub fn new(def: ValueDef, index: usize) -> ValueState
pub fn new(def: ValueDef, index: usize) -> ValueState
Create a new value state.
Sourcepub fn assign(&mut self, value: String, all_results: &mut [Vec<Value>])
pub fn assign(&mut self, value: String, all_results: &mut [Vec<Value>])
Assign a matched value.
Sourcepub fn assign_none(&mut self)
pub fn assign_none(&mut self)
Assign None (for unmatched optional capture groups).
Matches Python’s behavior: when a named group exists in a rule’s regex
but the group didn’t participate in the match (optional group), Python’s
groupdict() yields None for that key, and AssignVar(None) is called,
which clears the current value and updates the Filldown cache.
Without this, stale Filldown values persist across records when an optional group stops matching.
Sourcepub fn satisfies_required(&self) -> bool
pub fn satisfies_required(&self) -> bool
Check if Required constraint is satisfied.
Sourcepub fn take_for_record(&mut self) -> Value
pub fn take_for_record(&mut self) -> Value
Get current value for recording.
Trait Implementations§
Source§impl Clone for ValueState
impl Clone for ValueState
Source§fn clone(&self) -> ValueState
fn clone(&self) -> ValueState
Returns a duplicate of the value. Read more
1.0.0 · 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 ValueState
impl RefUnwindSafe for ValueState
impl Send for ValueState
impl Sync for ValueState
impl Unpin for ValueState
impl UnwindSafe for ValueState
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