Enum Node

Source
pub enum Node {
Show 17 variants Module(OwnedPtr<Module>), Struct(OwnedPtr<Struct>), Class(OwnedPtr<Class>), Exception(OwnedPtr<Exception>), Field(OwnedPtr<Field>), Interface(OwnedPtr<Interface>), Operation(OwnedPtr<Operation>), Parameter(OwnedPtr<Parameter>), Enum(OwnedPtr<Enum>), Enumerator(OwnedPtr<Enumerator>), CustomType(OwnedPtr<CustomType>), TypeAlias(OwnedPtr<TypeAlias>), ResultType(OwnedPtr<ResultType>), Sequence(OwnedPtr<Sequence>), Dictionary(OwnedPtr<Dictionary>), Primitive(OwnedPtr<Primitive>), Attribute(OwnedPtr<Attribute>),
}
Expand description

Represents a node in the Abstract Syntax Tree.

There is one variant for each kind of Slice element that can be stored in the AST, and each variant holds a single instance of its corresponding element wrapped in an OwnedPtr.

Variants§

§

Module(OwnedPtr<Module>)

§

Struct(OwnedPtr<Struct>)

§

Class(OwnedPtr<Class>)

§

Exception(OwnedPtr<Exception>)

§

Field(OwnedPtr<Field>)

§

Interface(OwnedPtr<Interface>)

§

Operation(OwnedPtr<Operation>)

§

Parameter(OwnedPtr<Parameter>)

§

Enum(OwnedPtr<Enum>)

§

Enumerator(OwnedPtr<Enumerator>)

§

CustomType(OwnedPtr<CustomType>)

§

TypeAlias(OwnedPtr<TypeAlias>)

§

ResultType(OwnedPtr<ResultType>)

§

Sequence(OwnedPtr<Sequence>)

§

Dictionary(OwnedPtr<Dictionary>)

§

Primitive(OwnedPtr<Primitive>)

§

Attribute(OwnedPtr<Attribute>)

Trait Implementations§

Source§

impl Debug for Node

Source§

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

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

impl Display for Node

Source§

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

Writes the identifier of this node’s variant to the given formatter (pascal cased).

Source§

impl<'a> From<&'a Node> for &'a dyn Element

Source§

fn from(node: &'a Node) -> &'a dyn Element

Unwraps a node to a dynamically typed reference of a Slice Element.

Source§

impl From<OwnedPtr<Attribute>> for Node

Source§

fn from(ptr: OwnedPtr<Attribute>) -> Node

Wraps the OwnedPtr<Attribute> in a Node of the corresponding variant Node::Attribute.

Source§

impl From<OwnedPtr<Class>> for Node

Source§

fn from(ptr: OwnedPtr<Class>) -> Node

Wraps the OwnedPtr<Class> in a Node of the corresponding variant Node::Class.

Source§

impl From<OwnedPtr<CustomType>> for Node

Source§

fn from(ptr: OwnedPtr<CustomType>) -> Node

Wraps the OwnedPtr<CustomType> in a Node of the corresponding variant Node::CustomType.

Source§

impl From<OwnedPtr<Dictionary>> for Node

Source§

fn from(ptr: OwnedPtr<Dictionary>) -> Node

Wraps the OwnedPtr<Dictionary> in a Node of the corresponding variant Node::Dictionary.

Source§

impl From<OwnedPtr<Enum>> for Node

Source§

fn from(ptr: OwnedPtr<Enum>) -> Node

Wraps the OwnedPtr<Enum> in a Node of the corresponding variant Node::Enum.

Source§

impl From<OwnedPtr<Enumerator>> for Node

Source§

fn from(ptr: OwnedPtr<Enumerator>) -> Node

Wraps the OwnedPtr<Enumerator> in a Node of the corresponding variant Node::Enumerator.

Source§

impl From<OwnedPtr<Exception>> for Node

Source§

fn from(ptr: OwnedPtr<Exception>) -> Node

Wraps the OwnedPtr<Exception> in a Node of the corresponding variant Node::Exception.

Source§

impl From<OwnedPtr<Field>> for Node

Source§

fn from(ptr: OwnedPtr<Field>) -> Node

Wraps the OwnedPtr<Field> in a Node of the corresponding variant Node::Field.

Source§

impl From<OwnedPtr<Interface>> for Node

Source§

fn from(ptr: OwnedPtr<Interface>) -> Node

Wraps the OwnedPtr<Interface> in a Node of the corresponding variant Node::Interface.

Source§

impl From<OwnedPtr<Module>> for Node

Source§

fn from(ptr: OwnedPtr<Module>) -> Node

Wraps the OwnedPtr<Module> in a Node of the corresponding variant Node::Module.

Source§

impl From<OwnedPtr<Operation>> for Node

Source§

fn from(ptr: OwnedPtr<Operation>) -> Node

Wraps the OwnedPtr<Operation> in a Node of the corresponding variant Node::Operation.

Source§

impl From<OwnedPtr<Parameter>> for Node

Source§

fn from(ptr: OwnedPtr<Parameter>) -> Node

Wraps the OwnedPtr<Parameter> in a Node of the corresponding variant Node::Parameter.

Source§

impl From<OwnedPtr<ResultType>> for Node

Source§

fn from(ptr: OwnedPtr<ResultType>) -> Node

Wraps the OwnedPtr<ResultType> in a Node of the corresponding variant Node::ResultType.

Source§

impl From<OwnedPtr<Sequence>> for Node

Source§

fn from(ptr: OwnedPtr<Sequence>) -> Node

Wraps the OwnedPtr<Sequence> in a Node of the corresponding variant Node::Sequence.

Source§

impl From<OwnedPtr<Struct>> for Node

Source§

fn from(ptr: OwnedPtr<Struct>) -> Node

Wraps the OwnedPtr<Struct> in a Node of the corresponding variant Node::Struct.

Source§

impl From<OwnedPtr<TypeAlias>> for Node

Source§

fn from(ptr: OwnedPtr<TypeAlias>) -> Node

Wraps the OwnedPtr<TypeAlias> in a Node of the corresponding variant Node::TypeAlias.

Source§

impl<'a> TryFrom<&'a Node> for &'a Attribute

Source§

fn try_from(node: &'a Node) -> Result<&'a Attribute, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Class

Source§

fn try_from(node: &'a Node) -> Result<&'a Class, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a CustomType

Source§

fn try_from(node: &'a Node) -> Result<&'a CustomType, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Dictionary

Source§

fn try_from(node: &'a Node) -> Result<&'a Dictionary, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Enum

Source§

fn try_from(node: &'a Node) -> Result<&'a Enum, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Enumerator

Source§

fn try_from(node: &'a Node) -> Result<&'a Enumerator, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Exception

Source§

fn try_from(node: &'a Node) -> Result<&'a Exception, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Field

Source§

fn try_from(node: &'a Node) -> Result<&'a Field, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Interface

Source§

fn try_from(node: &'a Node) -> Result<&'a Interface, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Module

Source§

fn try_from(node: &'a Node) -> Result<&'a Module, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Operation

Source§

fn try_from(node: &'a Node) -> Result<&'a Operation, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Attribute>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Attribute>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Class>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Class>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<CustomType>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<CustomType>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Dictionary>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Dictionary>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Enum>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Enum>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Enumerator>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Enumerator>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Exception>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Exception>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Field>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Field>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Interface>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Interface>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Module>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Module>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Operation>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Operation>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Parameter>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Parameter>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Primitive>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Primitive>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<ResultType>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<ResultType>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Sequence>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Sequence>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<Struct>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<Struct>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a OwnedPtr<TypeAlias>

Source§

fn try_from(node: &'a Node) -> Result<&'a OwnedPtr<TypeAlias>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

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

Source§

fn try_from(node: &'a Node) -> Result<&'a Parameter, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Primitive

Source§

fn try_from(node: &'a Node) -> Result<&'a Primitive, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a ResultType

Source§

fn try_from(node: &'a Node) -> Result<&'a ResultType, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Sequence

Source§

fn try_from(node: &'a Node) -> Result<&'a Sequence, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a Struct

Source§

fn try_from(node: &'a Node) -> Result<&'a Struct, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a TypeAlias

Source§

fn try_from(node: &'a Node) -> Result<&'a TypeAlias, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a dyn Entity

Source§

fn try_from(node: &'a Node) -> Result<&'a dyn Entity, Self::Error>

Attempts to unwrap a node to a dynamically typed reference of a Slice Entity.

If the Slice element held by the node implements Entity, this succeeds and returns a typed reference, otherwise this fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a dyn NamedSymbol

Source§

fn try_from(node: &'a Node) -> Result<&'a dyn NamedSymbol, Self::Error>

Attempts to unwrap a node to a dynamically typed reference of a Slice NamedSymbol.

If the Slice element held by the node implements NamedSymbol, this succeeds and returns a typed reference, otherwise this fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for &'a dyn Type

Source§

fn try_from(node: &'a Node) -> Result<&'a dyn Type, Self::Error>

Attempts to unwrap a node to a dynamically typed reference of a Slice Type.

If the Slice element held by the node implements Type, this succeeds and returns a typed reference, otherwise this fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Attribute>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Attribute>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Class>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Class>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<CustomType>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<CustomType>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Dictionary>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Dictionary>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Enum>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Enum>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Enumerator>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Enumerator>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Exception>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Exception>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Field>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Field>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Interface>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Interface>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Module>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Module>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Operation>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Operation>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Parameter>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Parameter>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Primitive>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Primitive>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<ResultType>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<ResultType>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Sequence>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Sequence>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<Struct>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<Struct>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<TypeAlias>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<TypeAlias>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<dyn Entity>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<dyn Entity>, Self::Error>

Attempts to unwrap a node to a WeakPtr of a Slice Entity.

If the Slice element held by the node implements Entity, this succeeds and returns a typed pointer, otherwise this fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a Node> for WeakPtr<dyn Type>

Source§

fn try_from(node: &'a Node) -> Result<WeakPtr<dyn Type>, Self::Error>

Attempts to unwrap a node to a WeakPtr of a Slice Type.

If the Slice element held by the node implements Type, this succeeds and returns a typed pointer, otherwise this fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Attribute>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<Attribute>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Class>

Source§

fn try_from(node: &'a mut Node) -> Result<&'a mut OwnedPtr<Class>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<CustomType>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<CustomType>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Dictionary>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<Dictionary>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Enum>

Source§

fn try_from(node: &'a mut Node) -> Result<&'a mut OwnedPtr<Enum>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Enumerator>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<Enumerator>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Exception>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<Exception>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Field>

Source§

fn try_from(node: &'a mut Node) -> Result<&'a mut OwnedPtr<Field>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Interface>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<Interface>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Module>

Source§

fn try_from(node: &'a mut Node) -> Result<&'a mut OwnedPtr<Module>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Operation>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<Operation>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Parameter>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<Parameter>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Primitive>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<Primitive>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<ResultType>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<ResultType>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Sequence>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<Sequence>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<Struct>

Source§

fn try_from(node: &'a mut Node) -> Result<&'a mut OwnedPtr<Struct>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

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

impl<'a> TryFrom<&'a mut Node> for &'a mut OwnedPtr<TypeAlias>

Source§

fn try_from( node: &'a mut Node, ) -> Result<&'a mut OwnedPtr<TypeAlias>, Self::Error>

Attempts to unwrap a node to the specified concrete type.

If the Slice element held by the node is the specified type, this succeeds, and returns the unwrapped element in the requested container. Otherwise this method fails and returns an error message.

Source§

type Error = LookupError

The type returned in the event of a conversion error.

Auto Trait Implementations§

§

impl Freeze for Node

§

impl !RefUnwindSafe for Node

§

impl !Send for Node

§

impl !Sync for Node

§

impl Unpin for Node

§

impl !UnwindSafe for Node

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

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.