Struct glsl_lang::ast::Node[][src]

pub struct Node<T> where
    T: NodeContent
{ pub content: T, pub span: Option<NodeSpan>, }

A syntax node with span information

Fields

content: T

Contents of this syntax node

span: Option<NodeSpan>

Span in the input this node was parsed from

Implementations

impl<T> Node<T> where
    T: NodeContent
[src]

pub fn new(content: T, span: Option<NodeSpan>) -> Node<T>[src]

Create a new syntax node with span information

pub fn into_inner(self) -> T[src]

Return the wrapped syntax node, discarding the span information

pub fn map<U>(self, f: impl FnOnce(T) -> U) -> Node<U> where
    U: NodeContent
[src]

Map this content of this node into a new node

pub fn map_spanned<U>(self, f: impl FnOnce(Node<T>) -> U) -> Node<U> where
    U: NodeContent
[src]

Map this content of this node into a new node with the same span

Trait Implementations

impl<T> Clone for Node<T> where
    T: Clone + NodeContent
[src]

impl<T> Copy for Node<T> where
    T: NodeContent + Copy
[src]

impl<T> Debug for Node<T> where
    T: Debug + NodeContent
[src]

impl<T> Deref for Node<T> where
    T: NodeContent
[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for Node<T> where
    T: NodeContent
[src]

impl<T> Display for Node<T> where
    T: NodeContent + Display
[src]

impl From<Node<TypeNameData>> for TypeSpecifierNonArray[src]

impl<T> From<T> for Node<T> where
    T: NodeContent
[src]

impl FromIterator<Node<StatementData>> for CompoundStatementData[src]

impl<T> NodeContentEq for Node<T> where
    T: NodeContent + NodeContentEq
[src]

impl<T> NodeDisplay for Node<T> where
    T: NodeContentDisplay + NodeContent
[src]

impl<T> PartialEq<Node<T>> for Node<T> where
    T: PartialEq<T> + NodeContent
[src]

impl<T> StructuralPartialEq for Node<T> where
    T: NodeContent
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Node<T> where
    T: RefUnwindSafe

impl<T> Send for Node<T> where
    T: Send

impl<T> Sync for Node<T> where
    T: Sync

impl<T> Unpin for Node<T> where
    T: Unpin

impl<T> UnwindSafe for Node<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoResult<T> for T[src]

type Err = Infallible

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.