#[non_exhaustive]pub struct PartialSymbolStack<'a> {
pub symbols: VecDeque<&'a str>,
pub variable: Option<SymbolStackVariable>,
}Expand description
A symbol stack pattern: known symbols, top first, over an optional unknown rest.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.symbols: VecDeque<&'a str>The known symbols, top first.
variable: Option<SymbolStackVariable>The unknown rest below them; None when the stack ends there.
Implementations§
Source§impl<'a> PartialSymbolStack<'a>
impl<'a> PartialSymbolStack<'a>
Sourcepub fn new(
symbols: VecDeque<&'a str>,
variable: Option<SymbolStackVariable>,
) -> Self
pub fn new( symbols: VecDeque<&'a str>, variable: Option<SymbolStackVariable>, ) -> Self
symbols, top first, over variable.
Sourcepub fn from_variable(variable: SymbolStackVariable) -> Self
pub fn from_variable(variable: SymbolStackVariable) -> Self
Only the unknown rest variable.
Sourcepub fn with_offset(&self, offset: u32) -> Option<Self>
pub fn with_offset(&self, offset: u32) -> Option<Self>
This stack with its variable renumbered offset places up; None past the last number.
Sourcepub fn apply_bindings(&self, bindings: &PartialBindings<'a>) -> Self
pub fn apply_bindings(&self, bindings: &PartialBindings<'a>) -> Self
This stack with its variable replaced by what bindings binds it to.
Trait Implementations§
Source§impl<'a> Clone for PartialSymbolStack<'a>
impl<'a> Clone for PartialSymbolStack<'a>
Source§impl<'a> Debug for PartialSymbolStack<'a>
impl<'a> Debug for PartialSymbolStack<'a>
Source§impl<'a> Default for PartialSymbolStack<'a>
impl<'a> Default for PartialSymbolStack<'a>
impl<'a> Eq for PartialSymbolStack<'a>
Source§impl<'a> Ord for PartialSymbolStack<'a>
impl<'a> Ord for PartialSymbolStack<'a>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<'a> PartialEq for PartialSymbolStack<'a>
impl<'a> PartialEq for PartialSymbolStack<'a>
Source§impl<'a> PartialOrd for PartialSymbolStack<'a>
impl<'a> PartialOrd for PartialSymbolStack<'a>
impl<'a> StructuralPartialEq for PartialSymbolStack<'a>
Auto Trait Implementations§
impl<'a> Forget for PartialSymbolStack<'a>
impl<'a> Freeze for PartialSymbolStack<'a>
impl<'a> RefUnwindSafe for PartialSymbolStack<'a>
impl<'a> Send for PartialSymbolStack<'a>
impl<'a> Sync for PartialSymbolStack<'a>
impl<'a> Unpin for PartialSymbolStack<'a>
impl<'a> UnsafeUnpin for PartialSymbolStack<'a>
impl<'a> UnwindSafe for PartialSymbolStack<'a>
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