Skip to main content

AnyRootNodeRef

Enum AnyRootNodeRef 

Source
pub enum AnyRootNodeRef<'a> {
Show 27 variants Mod(&'a Mod), Stmt(&'a Stmt), Expr(&'a Expr), ExceptHandler(&'a ExceptHandler), InterpolatedStringElement(&'a InterpolatedStringElement), Pattern(&'a Pattern), TypeParam(&'a TypeParam), InterpolatedStringFormatSpec(&'a InterpolatedStringFormatSpec), PatternArguments(&'a PatternArguments), PatternKeyword(&'a PatternKeyword), Comprehension(&'a Comprehension), Arguments(&'a Arguments), Parameters(&'a Parameters), Parameter(&'a Parameter), ParameterWithDefault(&'a ParameterWithDefault), Keyword(&'a Keyword), Alias(&'a Alias), WithItem(&'a WithItem), MatchCase(&'a MatchCase), Decorator(&'a Decorator), ElifElseClause(&'a ElifElseClause), TypeParams(&'a TypeParams), FString(&'a FString), TString(&'a TString), StringLiteral(&'a StringLiteral), BytesLiteral(&'a BytesLiteral), Identifier(&'a Identifier),
}
Expand description

An enumeration of all AST nodes.

Unlike AnyNodeRef, this type does not flatten nested enums, so its variants only consist of the “root” AST node types. This is useful as it exposes references to the original enums, not just references to their inner values.

For example, AnyRootNodeRef::Mod contains a reference to the Mod enum, while AnyNodeRef has top-level AnyNodeRef::ModModule and AnyNodeRef::ModExpression variants.

Variants§

§

Mod(&'a Mod)

§

Stmt(&'a Stmt)

§

Expr(&'a Expr)

§

ExceptHandler(&'a ExceptHandler)

§

InterpolatedStringElement(&'a InterpolatedStringElement)

§

Pattern(&'a Pattern)

§

TypeParam(&'a TypeParam)

§

InterpolatedStringFormatSpec(&'a InterpolatedStringFormatSpec)

§

PatternArguments(&'a PatternArguments)

§

PatternKeyword(&'a PatternKeyword)

§

Comprehension(&'a Comprehension)

§

Arguments(&'a Arguments)

§

Parameters(&'a Parameters)

§

Parameter(&'a Parameter)

§

ParameterWithDefault(&'a ParameterWithDefault)

§

Keyword(&'a Keyword)

§

Alias(&'a Alias)

§

WithItem(&'a WithItem)

§

MatchCase(&'a MatchCase)

§

Decorator(&'a Decorator)

§

ElifElseClause(&'a ElifElseClause)

§

TypeParams(&'a TypeParams)

§

FString(&'a FString)

§

TString(&'a TString)

§

StringLiteral(&'a StringLiteral)

§

BytesLiteral(&'a BytesLiteral)

§

Identifier(&'a Identifier)

Implementations§

Source§

impl<'a> AnyRootNodeRef<'a>

Source

pub fn visit_source_order<'b, V>(self, visitor: &mut V)
where 'a: 'b, V: SourceOrderVisitor<'b> + ?Sized,

Trait Implementations§

Source§

impl<'a> Clone for AnyRootNodeRef<'a>

Source§

fn clone(&self) -> AnyRootNodeRef<'a>

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<'a> Debug for AnyRootNodeRef<'a>

Source§

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

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

impl<'a> From<&'a Alias> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Alias) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Arguments> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Arguments) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a BytesLiteral> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a BytesLiteral) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Comprehension> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Comprehension) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Decorator> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Decorator) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ElifElseClause> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a ElifElseClause) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ExceptHandler> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a ExceptHandler) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Expr> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Expr) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a FString> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a FString) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Identifier> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Identifier) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a InterpolatedStringElement> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a InterpolatedStringElement) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a InterpolatedStringFormatSpec> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a InterpolatedStringFormatSpec) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Keyword> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Keyword) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a MatchCase> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a MatchCase) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Mod> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Mod) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Parameter> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Parameter) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a ParameterWithDefault> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a ParameterWithDefault) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Parameters> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Parameters) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Pattern> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Pattern) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a PatternArguments> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a PatternArguments) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a PatternKeyword> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a PatternKeyword) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Stmt> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a Stmt) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a StringLiteral> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a StringLiteral) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a TString> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a TString) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a TypeParam> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a TypeParam) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a TypeParams> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a TypeParams) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a WithItem> for AnyRootNodeRef<'a>

Source§

fn from(node: &'a WithItem) -> AnyRootNodeRef<'a>

Converts to this type from the input type.
Source§

impl<'a> GetSize for AnyRootNodeRef<'a>

Source§

fn get_heap_size(&self) -> usize

Determines how many bytes this object occupies inside the heap. Read more
Source§

fn get_heap_size_with_tracker<TRACKER>( &self, tracker: TRACKER, ) -> (usize, TRACKER)
where TRACKER: GetSizeTracker,

Determines how many bytes this object occupies inside the heap while using a tracker. Read more
Source§

fn get_stack_size() -> usize

Determines how may bytes this object occupies inside the stack. Read more
Source§

fn get_size(&self) -> usize

Determines the total size of the object. Read more
Source§

fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)
where T: GetSizeTracker,

Determines the total size of the object while using a tracker. Read more
Source§

impl HasNodeIndex for AnyRootNodeRef<'_>

Source§

fn node_index(&self) -> &AtomicNodeIndex

Returns the AtomicNodeIndex for this node.
Source§

impl<'a> PartialEq for AnyRootNodeRef<'a>

Source§

fn eq(&self, other: &AnyRootNodeRef<'a>) -> 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 Ranged for AnyRootNodeRef<'_>

Source§

fn range(&self) -> TextRange

The range of this item in the source text.
Source§

fn start(&self) -> TextSize

The start offset of this item in the source text.
Source§

fn end(&self) -> TextSize

The end offset of this item in the source text.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Alias

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Alias, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Arguments

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Arguments, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a BytesLiteral

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a BytesLiteral, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Comprehension

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Comprehension, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Decorator

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Decorator, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ElifElseClause

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ElifElseClause, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExceptHandler

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExceptHandler, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExceptHandlerExceptHandler

Source§

type Error = ()

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

fn try_from( node: AnyRootNodeRef<'a>, ) -> Result<&'a ExceptHandlerExceptHandler, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Expr

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Expr, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprAttribute

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprAttribute, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprAwait

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprAwait, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprBinOp

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprBinOp, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprBoolOp

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprBoolOp, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprBooleanLiteral

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprBooleanLiteral, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprBytesLiteral

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprBytesLiteral, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprCall

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprCall, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprCompare

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprCompare, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprDict

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprDict, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprDictComp

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprDictComp, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprEllipsisLiteral

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprEllipsisLiteral, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprFString

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprFString, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprGenerator

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprGenerator, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprIf

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprIf, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprIpyEscapeCommand

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprIpyEscapeCommand, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprLambda

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprLambda, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprList

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprList, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprListComp

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprListComp, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprName

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprName, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprNamed

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprNamed, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprNoneLiteral

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprNoneLiteral, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprNumberLiteral

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprNumberLiteral, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprSet

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprSet, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprSetComp

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprSetComp, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprSlice

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprSlice, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprStarred

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprStarred, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprStringLiteral

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprStringLiteral, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprSubscript

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprSubscript, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprTString

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprTString, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprTuple

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprTuple, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprUnaryOp

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprUnaryOp, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprYield

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprYield, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ExprYieldFrom

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ExprYieldFrom, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a FString

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a FString, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Identifier

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Identifier, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a InterpolatedElement

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a InterpolatedElement, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a InterpolatedStringElement

Source§

type Error = ()

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

fn try_from( node: AnyRootNodeRef<'a>, ) -> Result<&'a InterpolatedStringElement, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a InterpolatedStringFormatSpec

Source§

type Error = ()

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

fn try_from( node: AnyRootNodeRef<'a>, ) -> Result<&'a InterpolatedStringFormatSpec, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a InterpolatedStringLiteralElement

Source§

type Error = ()

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

fn try_from( node: AnyRootNodeRef<'a>, ) -> Result<&'a InterpolatedStringLiteralElement, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Keyword

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Keyword, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a MatchCase

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a MatchCase, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Mod

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Mod, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ModExpression

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ModExpression, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ModModule

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ModModule, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Parameter

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Parameter, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a ParameterWithDefault

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a ParameterWithDefault, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Parameters

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Parameters, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Pattern

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Pattern, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a PatternArguments

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a PatternArguments, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a PatternKeyword

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a PatternKeyword, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a PatternMatchAs

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a PatternMatchAs, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a PatternMatchClass

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a PatternMatchClass, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a PatternMatchMapping

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a PatternMatchMapping, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a PatternMatchOr

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a PatternMatchOr, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a PatternMatchSequence

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a PatternMatchSequence, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a PatternMatchSingleton

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a PatternMatchSingleton, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a PatternMatchStar

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a PatternMatchStar, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a PatternMatchValue

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a PatternMatchValue, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a Stmt

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a Stmt, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtAnnAssign

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtAnnAssign, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtAssert

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtAssert, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtAssign

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtAssign, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtAugAssign

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtAugAssign, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtBreak

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtBreak, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtClassDef

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtClassDef, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtContinue

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtContinue, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtDelete

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtDelete, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtExpr

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtExpr, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtFor

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtFor, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtFunctionDef

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtFunctionDef, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtGlobal

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtGlobal, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtIf

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtIf, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtImport

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtImport, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtImportFrom

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtImportFrom, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtIpyEscapeCommand

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtIpyEscapeCommand, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtMatch

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtMatch, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtNonlocal

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtNonlocal, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtPass

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtPass, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtRaise

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtRaise, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtReturn

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtReturn, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtTry

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtTry, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtTypeAlias

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtTypeAlias, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtWhile

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtWhile, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StmtWith

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StmtWith, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a StringLiteral

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a StringLiteral, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a TString

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a TString, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a TypeParam

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a TypeParam, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a TypeParamParamSpec

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a TypeParamParamSpec, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a TypeParamTypeVar

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a TypeParamTypeVar, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a TypeParamTypeVarTuple

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a TypeParamTypeVarTuple, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a TypeParams

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a TypeParams, ()>

Performs the conversion.
Source§

impl<'a> TryFrom<AnyRootNodeRef<'a>> for &'a WithItem

Source§

type Error = ()

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

fn try_from(node: AnyRootNodeRef<'a>) -> Result<&'a WithItem, ()>

Performs the conversion.
Source§

impl<'a> Copy for AnyRootNodeRef<'a>

Source§

impl<'a> StructuralPartialEq for AnyRootNodeRef<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for AnyRootNodeRef<'a>

§

impl<'a> RefUnwindSafe for AnyRootNodeRef<'a>

§

impl<'a> Send for AnyRootNodeRef<'a>

§

impl<'a> Sync for AnyRootNodeRef<'a>

§

impl<'a> Unpin for AnyRootNodeRef<'a>

§

impl<'a> UnsafeUnpin for AnyRootNodeRef<'a>

§

impl<'a> UnwindSafe for AnyRootNodeRef<'a>

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, U> ExactFrom<T> for U
where U: TryFrom<T>,

Source§

fn exact_from(value: T) -> U

Source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

Source§

fn exact_into(self) -> U

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

Source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

Source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

Source§

impl<T> ToDebugString for T
where T: Debug,

Source§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

§Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
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.
Source§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

Source§

fn wrapping_into(self) -> U

Source§

impl<T> PyThreadingConstraint for T