Skip to main content

AnyNode

Enum AnyNode 

Source
pub enum AnyNode<'tree> {
Show 170 variants DeclarationStatement(DeclarationStatement<'tree>), Expression(Expression<'tree>), Literal(Literal<'tree>), LiteralPattern(LiteralPattern<'tree>), Pattern(Pattern<'tree>), Type(Type<'tree>), AbstractType(AbstractType<'tree>), Arguments(Arguments<'tree>), ArrayExpression(ArrayExpression<'tree>), ArrayType(ArrayType<'tree>), AssignmentExpression(AssignmentExpression<'tree>), AssociatedType(AssociatedType<'tree>), AsyncBlock(AsyncBlock<'tree>), Attribute(Attribute<'tree>), AttributeItem(AttributeItem<'tree>), AwaitExpression(AwaitExpression<'tree>), BaseFieldInitializer(BaseFieldInitializer<'tree>), BinaryExpression(BinaryExpression<'tree>), Block(Block<'tree>), BlockComment(BlockComment<'tree>), BooleanLiteral(BooleanLiteral<'tree>), BoundedType(BoundedType<'tree>), BracketedType(BracketedType<'tree>), BreakExpression(BreakExpression<'tree>), CallExpression(CallExpression<'tree>), CapturedPattern(CapturedPattern<'tree>), ClosureExpression(ClosureExpression<'tree>), ClosureParameters(ClosureParameters<'tree>), CompoundAssignmentExpr(CompoundAssignmentExpr<'tree>), ConstBlock(ConstBlock<'tree>), ConstItem(ConstItem<'tree>), ConstParameter(ConstParameter<'tree>), ContinueExpression(ContinueExpression<'tree>), DeclarationList(DeclarationList<'tree>), DynamicType(DynamicType<'tree>), ElseClause(ElseClause<'tree>), EmptyStatement(EmptyStatement<'tree>), EnumItem(EnumItem<'tree>), EnumVariant(EnumVariant<'tree>), EnumVariantList(EnumVariantList<'tree>), ExpressionStatement(ExpressionStatement<'tree>), ExternCrateDeclaration(ExternCrateDeclaration<'tree>), ExternModifier(ExternModifier<'tree>), FieldDeclaration(FieldDeclaration<'tree>), FieldDeclarationList(FieldDeclarationList<'tree>), FieldExpression(FieldExpression<'tree>), FieldInitializer(FieldInitializer<'tree>), FieldInitializerList(FieldInitializerList<'tree>), FieldPattern(FieldPattern<'tree>), ForExpression(ForExpression<'tree>), ForLifetimes(ForLifetimes<'tree>), ForeignModItem(ForeignModItem<'tree>), FragmentSpecifier(FragmentSpecifier<'tree>), FunctionItem(FunctionItem<'tree>), FunctionModifiers(FunctionModifiers<'tree>), FunctionSignatureItem(FunctionSignatureItem<'tree>), FunctionType(FunctionType<'tree>), GenBlock(GenBlock<'tree>), GenericFunction(GenericFunction<'tree>), GenericPattern(GenericPattern<'tree>), GenericType(GenericType<'tree>), GenericTypeWithTurbofish(GenericTypeWithTurbofish<'tree>), HigherRankedTraitBound(HigherRankedTraitBound<'tree>), IfExpression(IfExpression<'tree>), ImplItem(ImplItem<'tree>), IndexExpression(IndexExpression<'tree>), InnerAttributeItem(InnerAttributeItem<'tree>), InnerDocCommentMarker(InnerDocCommentMarker<'tree>), Label(Label<'tree>), LetChain(LetChain<'tree>), LetCondition(LetCondition<'tree>), LetDeclaration(LetDeclaration<'tree>), Lifetime(Lifetime<'tree>), LifetimeParameter(LifetimeParameter<'tree>), LineComment(LineComment<'tree>), LoopExpression(LoopExpression<'tree>), MacroDefinition(MacroDefinition<'tree>), MacroInvocation(MacroInvocation<'tree>), MacroRule(MacroRule<'tree>), MatchArm(MatchArm<'tree>), MatchBlock(MatchBlock<'tree>), MatchExpression(MatchExpression<'tree>), MatchPattern(MatchPattern<'tree>), ModItem(ModItem<'tree>), MutPattern(MutPattern<'tree>), NegativeLiteral(NegativeLiteral<'tree>), NeverType(NeverType<'tree>), OrPattern(OrPattern<'tree>), OrderedFieldDeclarationList(OrderedFieldDeclarationList<'tree>), OuterDocCommentMarker(OuterDocCommentMarker<'tree>), Parameter(Parameter<'tree>), Parameters(Parameters<'tree>), ParenthesizedExpression(ParenthesizedExpression<'tree>), PointerType(PointerType<'tree>), QualifiedType(QualifiedType<'tree>), RangeExpression(RangeExpression<'tree>), RangePattern(RangePattern<'tree>), RawStringLiteral(RawStringLiteral<'tree>), RefPattern(RefPattern<'tree>), ReferenceExpression(ReferenceExpression<'tree>), ReferencePattern(ReferencePattern<'tree>), ReferenceType(ReferenceType<'tree>), RemainingFieldPattern(RemainingFieldPattern<'tree>), RemovedTraitBound(RemovedTraitBound<'tree>), ReturnExpression(ReturnExpression<'tree>), ScopedIdentifier(ScopedIdentifier<'tree>), ScopedTypeIdentifier(ScopedTypeIdentifier<'tree>), ScopedUseList(ScopedUseList<'tree>), SelfParameter(SelfParameter<'tree>), ShorthandFieldInitializer(ShorthandFieldInitializer<'tree>), SlicePattern(SlicePattern<'tree>), SourceFile(SourceFile<'tree>), StaticItem(StaticItem<'tree>), StringLiteral(StringLiteral<'tree>), StructExpression(StructExpression<'tree>), StructItem(StructItem<'tree>), StructPattern(StructPattern<'tree>), TokenBindingPattern(TokenBindingPattern<'tree>), TokenRepetition(TokenRepetition<'tree>), TokenRepetitionPattern(TokenRepetitionPattern<'tree>), TokenTree(TokenTree<'tree>), TokenTreePattern(TokenTreePattern<'tree>), TraitBounds(TraitBounds<'tree>), TraitItem(TraitItem<'tree>), TryBlock(TryBlock<'tree>), TryExpression(TryExpression<'tree>), TupleExpression(TupleExpression<'tree>), TuplePattern(TuplePattern<'tree>), TupleStructPattern(TupleStructPattern<'tree>), TupleType(TupleType<'tree>), TypeArguments(TypeArguments<'tree>), TypeBinding(TypeBinding<'tree>), TypeCastExpression(TypeCastExpression<'tree>), TypeItem(TypeItem<'tree>), TypeParameter(TypeParameter<'tree>), TypeParameters(TypeParameters<'tree>), UnaryExpression(UnaryExpression<'tree>), UnionItem(UnionItem<'tree>), UnitExpression(UnitExpression<'tree>), UnitType(UnitType<'tree>), UnsafeBlock(UnsafeBlock<'tree>), UseAsClause(UseAsClause<'tree>), UseBounds(UseBounds<'tree>), UseDeclaration(UseDeclaration<'tree>), UseList(UseList<'tree>), UseWildcard(UseWildcard<'tree>), VariadicParameter(VariadicParameter<'tree>), VisibilityModifier(VisibilityModifier<'tree>), WhereClause(WhereClause<'tree>), WherePredicate(WherePredicate<'tree>), WhileExpression(WhileExpression<'tree>), YieldExpression(YieldExpression<'tree>), CharLiteral(CharLiteral<'tree>), Crate(Crate<'tree>), DocComment(DocComment<'tree>), EscapeSequence(EscapeSequence<'tree>), FieldIdentifier(FieldIdentifier<'tree>), FloatLiteral(FloatLiteral<'tree>), Identifier(Identifier<'tree>), IntegerLiteral(IntegerLiteral<'tree>), Metavariable(Metavariable<'tree>), MutableSpecifier(MutableSpecifier<'tree>), PrimitiveType(PrimitiveType<'tree>), SelfType(SelfType<'tree>), Shebang(Shebang<'tree>), ShorthandFieldIdentifier(ShorthandFieldIdentifier<'tree>), StringContent(StringContent<'tree>), Super(Super<'tree>), TypeIdentifier(TypeIdentifier<'tree>), Unknown(Node<'tree>),
}

Variants§

§

DeclarationStatement(DeclarationStatement<'tree>)

§

Expression(Expression<'tree>)

§

Literal(Literal<'tree>)

§

LiteralPattern(LiteralPattern<'tree>)

§

Pattern(Pattern<'tree>)

§

Type(Type<'tree>)

§

AbstractType(AbstractType<'tree>)

§

Arguments(Arguments<'tree>)

§

ArrayExpression(ArrayExpression<'tree>)

§

ArrayType(ArrayType<'tree>)

§

AssignmentExpression(AssignmentExpression<'tree>)

§

AssociatedType(AssociatedType<'tree>)

§

AsyncBlock(AsyncBlock<'tree>)

§

Attribute(Attribute<'tree>)

§

AttributeItem(AttributeItem<'tree>)

§

AwaitExpression(AwaitExpression<'tree>)

§

BaseFieldInitializer(BaseFieldInitializer<'tree>)

§

BinaryExpression(BinaryExpression<'tree>)

§

Block(Block<'tree>)

§

BlockComment(BlockComment<'tree>)

§

BooleanLiteral(BooleanLiteral<'tree>)

§

BoundedType(BoundedType<'tree>)

§

BracketedType(BracketedType<'tree>)

§

BreakExpression(BreakExpression<'tree>)

§

CallExpression(CallExpression<'tree>)

§

CapturedPattern(CapturedPattern<'tree>)

§

ClosureExpression(ClosureExpression<'tree>)

§

ClosureParameters(ClosureParameters<'tree>)

§

CompoundAssignmentExpr(CompoundAssignmentExpr<'tree>)

§

ConstBlock(ConstBlock<'tree>)

§

ConstItem(ConstItem<'tree>)

§

ConstParameter(ConstParameter<'tree>)

§

ContinueExpression(ContinueExpression<'tree>)

§

DeclarationList(DeclarationList<'tree>)

§

DynamicType(DynamicType<'tree>)

§

ElseClause(ElseClause<'tree>)

§

EmptyStatement(EmptyStatement<'tree>)

§

EnumItem(EnumItem<'tree>)

§

EnumVariant(EnumVariant<'tree>)

§

EnumVariantList(EnumVariantList<'tree>)

§

ExpressionStatement(ExpressionStatement<'tree>)

§

ExternCrateDeclaration(ExternCrateDeclaration<'tree>)

§

ExternModifier(ExternModifier<'tree>)

§

FieldDeclaration(FieldDeclaration<'tree>)

§

FieldDeclarationList(FieldDeclarationList<'tree>)

§

FieldExpression(FieldExpression<'tree>)

§

FieldInitializer(FieldInitializer<'tree>)

§

FieldInitializerList(FieldInitializerList<'tree>)

§

FieldPattern(FieldPattern<'tree>)

§

ForExpression(ForExpression<'tree>)

§

ForLifetimes(ForLifetimes<'tree>)

§

ForeignModItem(ForeignModItem<'tree>)

§

FragmentSpecifier(FragmentSpecifier<'tree>)

§

FunctionItem(FunctionItem<'tree>)

§

FunctionModifiers(FunctionModifiers<'tree>)

§

FunctionSignatureItem(FunctionSignatureItem<'tree>)

§

FunctionType(FunctionType<'tree>)

§

GenBlock(GenBlock<'tree>)

§

GenericFunction(GenericFunction<'tree>)

§

GenericPattern(GenericPattern<'tree>)

§

GenericType(GenericType<'tree>)

§

GenericTypeWithTurbofish(GenericTypeWithTurbofish<'tree>)

§

HigherRankedTraitBound(HigherRankedTraitBound<'tree>)

§

IfExpression(IfExpression<'tree>)

§

ImplItem(ImplItem<'tree>)

§

IndexExpression(IndexExpression<'tree>)

§

InnerAttributeItem(InnerAttributeItem<'tree>)

§

InnerDocCommentMarker(InnerDocCommentMarker<'tree>)

§

Label(Label<'tree>)

§

LetChain(LetChain<'tree>)

§

LetCondition(LetCondition<'tree>)

§

LetDeclaration(LetDeclaration<'tree>)

§

Lifetime(Lifetime<'tree>)

§

LifetimeParameter(LifetimeParameter<'tree>)

§

LineComment(LineComment<'tree>)

§

LoopExpression(LoopExpression<'tree>)

§

MacroDefinition(MacroDefinition<'tree>)

§

MacroInvocation(MacroInvocation<'tree>)

§

MacroRule(MacroRule<'tree>)

§

MatchArm(MatchArm<'tree>)

§

MatchBlock(MatchBlock<'tree>)

§

MatchExpression(MatchExpression<'tree>)

§

MatchPattern(MatchPattern<'tree>)

§

ModItem(ModItem<'tree>)

§

MutPattern(MutPattern<'tree>)

§

NegativeLiteral(NegativeLiteral<'tree>)

§

NeverType(NeverType<'tree>)

§

OrPattern(OrPattern<'tree>)

§

OrderedFieldDeclarationList(OrderedFieldDeclarationList<'tree>)

§

OuterDocCommentMarker(OuterDocCommentMarker<'tree>)

§

Parameter(Parameter<'tree>)

§

Parameters(Parameters<'tree>)

§

ParenthesizedExpression(ParenthesizedExpression<'tree>)

§

PointerType(PointerType<'tree>)

§

QualifiedType(QualifiedType<'tree>)

§

RangeExpression(RangeExpression<'tree>)

§

RangePattern(RangePattern<'tree>)

§

RawStringLiteral(RawStringLiteral<'tree>)

§

RefPattern(RefPattern<'tree>)

§

ReferenceExpression(ReferenceExpression<'tree>)

§

ReferencePattern(ReferencePattern<'tree>)

§

ReferenceType(ReferenceType<'tree>)

§

RemainingFieldPattern(RemainingFieldPattern<'tree>)

§

RemovedTraitBound(RemovedTraitBound<'tree>)

§

ReturnExpression(ReturnExpression<'tree>)

§

ScopedIdentifier(ScopedIdentifier<'tree>)

§

ScopedTypeIdentifier(ScopedTypeIdentifier<'tree>)

§

ScopedUseList(ScopedUseList<'tree>)

§

SelfParameter(SelfParameter<'tree>)

§

ShorthandFieldInitializer(ShorthandFieldInitializer<'tree>)

§

SlicePattern(SlicePattern<'tree>)

§

SourceFile(SourceFile<'tree>)

§

StaticItem(StaticItem<'tree>)

§

StringLiteral(StringLiteral<'tree>)

§

StructExpression(StructExpression<'tree>)

§

StructItem(StructItem<'tree>)

§

StructPattern(StructPattern<'tree>)

§

TokenBindingPattern(TokenBindingPattern<'tree>)

§

TokenRepetition(TokenRepetition<'tree>)

§

TokenRepetitionPattern(TokenRepetitionPattern<'tree>)

§

TokenTree(TokenTree<'tree>)

§

TokenTreePattern(TokenTreePattern<'tree>)

§

TraitBounds(TraitBounds<'tree>)

§

TraitItem(TraitItem<'tree>)

§

TryBlock(TryBlock<'tree>)

§

TryExpression(TryExpression<'tree>)

§

TupleExpression(TupleExpression<'tree>)

§

TuplePattern(TuplePattern<'tree>)

§

TupleStructPattern(TupleStructPattern<'tree>)

§

TupleType(TupleType<'tree>)

§

TypeArguments(TypeArguments<'tree>)

§

TypeBinding(TypeBinding<'tree>)

§

TypeCastExpression(TypeCastExpression<'tree>)

§

TypeItem(TypeItem<'tree>)

§

TypeParameter(TypeParameter<'tree>)

§

TypeParameters(TypeParameters<'tree>)

§

UnaryExpression(UnaryExpression<'tree>)

§

UnionItem(UnionItem<'tree>)

§

UnitExpression(UnitExpression<'tree>)

§

UnitType(UnitType<'tree>)

§

UnsafeBlock(UnsafeBlock<'tree>)

§

UseAsClause(UseAsClause<'tree>)

§

UseBounds(UseBounds<'tree>)

§

UseDeclaration(UseDeclaration<'tree>)

§

UseList(UseList<'tree>)

§

UseWildcard(UseWildcard<'tree>)

§

VariadicParameter(VariadicParameter<'tree>)

§

VisibilityModifier(VisibilityModifier<'tree>)

§

WhereClause(WhereClause<'tree>)

§

WherePredicate(WherePredicate<'tree>)

§

WhileExpression(WhileExpression<'tree>)

§

YieldExpression(YieldExpression<'tree>)

§

CharLiteral(CharLiteral<'tree>)

§

Crate(Crate<'tree>)

§

DocComment(DocComment<'tree>)

§

EscapeSequence(EscapeSequence<'tree>)

§

FieldIdentifier(FieldIdentifier<'tree>)

§

FloatLiteral(FloatLiteral<'tree>)

§

Identifier(Identifier<'tree>)

§

IntegerLiteral(IntegerLiteral<'tree>)

§

Metavariable(Metavariable<'tree>)

§

MutableSpecifier(MutableSpecifier<'tree>)

§

PrimitiveType(PrimitiveType<'tree>)

§

SelfType(SelfType<'tree>)

§

Shebang(Shebang<'tree>)

§

ShorthandFieldIdentifier(ShorthandFieldIdentifier<'tree>)

§

StringContent(StringContent<'tree>)

§

Super(Super<'tree>)

§

TypeIdentifier(TypeIdentifier<'tree>)

§

Unknown(Node<'tree>)

Implementations§

Source§

impl<'tree> AnyNode<'tree>

Source

pub fn from_node(node: Node<'tree>, src: &'tree [u8]) -> Self

Trait Implementations§

Source§

impl<'tree> Clone for AnyNode<'tree>

Source§

fn clone(&self) -> AnyNode<'tree>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'tree> Debug for AnyNode<'tree>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'tree> PartialEq for AnyNode<'tree>

Source§

fn eq(&self, other: &AnyNode<'tree>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Spanned for AnyNode<'_>

Source§

fn span(&self) -> Span

Source§

fn start(&self) -> Point

Source§

fn end(&self) -> Point

Source§

impl<'tree> Eq for AnyNode<'tree>

Source§

impl<'tree> StructuralPartialEq for AnyNode<'tree>

Auto Trait Implementations§

§

impl<'tree> Freeze for AnyNode<'tree>

§

impl<'tree> RefUnwindSafe for AnyNode<'tree>

§

impl<'tree> Send for AnyNode<'tree>

§

impl<'tree> Sync for AnyNode<'tree>

§

impl<'tree> Unpin for AnyNode<'tree>

§

impl<'tree> UnsafeUnpin for AnyNode<'tree>

§

impl<'tree> UnwindSafe for AnyNode<'tree>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.