pub struct PatternContext {
pub stores: Vec<String>,
pub allow_irrefutable: bool,
pub fail_pop: Vec<BlockIdx>,
pub on_top: usize,
}Expand description
The pattern context holds information about captured names and jump targets.
Fields§
§stores: Vec<String>A list of names captured by the pattern.
allow_irrefutable: boolIf false, then any name captures against our subject will raise.
fail_pop: Vec<BlockIdx>A list of jump target labels used on pattern failure.
on_top: usizeThe number of items on top of the stack that should remain.
Implementations§
Source§impl PatternContext
impl PatternContext
pub const fn new() -> PatternContext
pub fn fail_pop_size(&self) -> usize
Trait Implementations§
Source§impl Clone for PatternContext
impl Clone for PatternContext
Source§fn clone(&self) -> PatternContext
fn clone(&self) -> PatternContext
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 moreSource§impl Default for PatternContext
impl Default for PatternContext
Source§fn default() -> PatternContext
fn default() -> PatternContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PatternContext
impl RefUnwindSafe for PatternContext
impl Send for PatternContext
impl Sync for PatternContext
impl Unpin for PatternContext
impl UnsafeUnpin for PatternContext
impl UnwindSafe for PatternContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more