pub struct At<T: AstNode, A: AstTypes = DefaultTypes>(pub T, pub A::Annotation);Expand description
A value with an annotation.
Tuple Fields§
§0: T§1: A::AnnotationImplementations§
Source§impl<T: AstNode, A: AstTypes> At<T, A>
impl<T: AstNode, A: AstTypes> At<T, A>
pub fn value(&self) -> &T
pub fn a(&self) -> &A::Annotation
pub fn map<U: AstNode>(self, f: impl FnOnce(T) -> U) -> At<U, A>
pub fn map_ref<U: AstNode>(&self, f: impl FnOnce(&T) -> U) -> At<U, A>
pub fn map_a<B: AstTypes>( self, f: impl FnOnce(A::Annotation) -> B::Annotation, ) -> At<T, B>
Trait Implementations§
Source§impl<A: AstTypes, B: AstTypes> Foldable<A, B> for At<Expr<A>, A>
impl<A: AstTypes, B: AstTypes> Foldable<A, B> for At<Expr<A>, A>
Source§impl<A: AstTypes, B: AstTypes> Foldable<A, B> for At<Pat<A>, A>
impl<A: AstTypes, B: AstTypes> Foldable<A, B> for At<Pat<A>, A>
Source§impl<M: Match<A> + AstNode, A: AstTypes> Match<A> for At<M, A>
impl<M: Match<A> + AstNode, A: AstTypes> Match<A> for At<M, A>
Source§fn recurse(sub: &mut Subst<A>, pat: &Self, expr: &Self) -> bool
fn recurse(sub: &mut Subst<A>, pat: &Self, expr: &Self) -> bool
Implements recursive Subst-building for Self
Source§fn apply_rule(&mut self, pat: &Self, template: &Self) -> bool
fn apply_rule(&mut self, pat: &Self, template: &Self) -> bool
Applies a substitution rule from
pat to template on selfSource§fn match_with(&self, pat: &Self) -> Option<Subst<A>>
fn match_with(&self, pat: &Self) -> Option<Subst<A>>
Matches self against the provided pattern
Source§impl<T: PartialEq + AstNode, A: PartialEq + AstTypes> PartialEq for At<T, A>where
A::Annotation: PartialEq,
impl<T: PartialEq + AstNode, A: PartialEq + AstTypes> PartialEq for At<T, A>where
A::Annotation: PartialEq,
impl<T: Eq + AstNode, A: Eq + AstTypes> Eq for At<T, A>where
A::Annotation: Eq,
impl<T: AstNode, A: AstTypes> StructuralPartialEq for At<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for At<T, A>
impl<T, A> RefUnwindSafe for At<T, A>
impl<T, A> Send for At<T, A>
impl<T, A> Sync for At<T, A>
impl<T, A> Unpin for At<T, A>
impl<T, A> UnsafeUnpin for At<T, A>
impl<T, A> UnwindSafe for At<T, 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