pub enum StructPatternNode {
Ignore,
Literal(Value),
Bind(BindId),
Slice {
tuple: bool,
all: Option<BindId>,
binds: Box<[StructPatternNode]>,
},
SlicePrefix {
all: Option<BindId>,
prefix: Box<[StructPatternNode]>,
tail: Option<BindId>,
},
SliceSuffix {
all: Option<BindId>,
head: Option<BindId>,
suffix: Box<[StructPatternNode]>,
},
Struct {
all: Option<BindId>,
binds: Box<[(ArcStr, usize, StructPatternNode)]>,
},
Variant {
tag: ArcStr,
all: Option<BindId>,
binds: Box<[StructPatternNode]>,
},
}
Variants§
Implementations§
Source§impl StructPatternNode
impl StructPatternNode
pub fn compile<C: Ctx, E: UserEvent>( ctx: &mut ExecCtx<C, E>, type_predicate: &Type<NoRefs>, spec: &StructurePattern, scope: &ModPath, ) -> Result<Self>
pub fn ids<'a>(&'a self, f: &mut (dyn FnMut(BindId) + 'a))
pub fn bind<F: FnMut(BindId, Value)>(&self, v: &Value, f: &mut F)
pub fn unbind<F: FnMut(BindId)>(&self, f: &mut F)
pub fn is_match(&self, v: &Value) -> bool
pub fn is_refutable(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StructPatternNode
impl RefUnwindSafe for StructPatternNode
impl Send for StructPatternNode
impl Sync for StructPatternNode
impl Unpin for StructPatternNode
impl UnwindSafe for StructPatternNode
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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