Type Alias glsl_lang::ast::TypeName

source ·
pub type TypeName = Node<TypeNameData>;
Expand description

Type alias for Node<TypeNameData>.

Aliased Type§

struct TypeName {
    pub content: TypeNameData,
    pub span: Option<NodeSpan>,
}

Fields§

§content: TypeNameData

Contents of this syntax node

§span: Option<NodeSpan>

Span in the input this node was parsed from

Implementations

source§

impl<T> Node<T>
where T: NodeContent,

source

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

Create a new syntax node with span information

source

pub fn into_inner(self) -> T

Return the wrapped syntax node, discarding the span information

source

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

Map this content of this node into a new node

source

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

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

Trait Implementations§

source§

impl Host for TypeName

source§

fn visit<V>(&self, visitor: &mut V)
where V: Visitor,

Visit an AST node.
source§

impl HostMut for TypeName

source§

fn visit_mut<V>(&mut self, visitor: &mut V)
where V: VisitorMut,

Visit an AST node.
source§

impl<U, T> AsRef<U> for Node<T>
where T: NodeContent + AsRef<U>,

source§

fn as_ref(&self) -> &U

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Clone for Node<T>
where T: Clone + NodeContent,

source§

fn clone(&self) -> Node<T>

Returns a copy 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<T> Debug for Node<T>
where T: Debug + NodeContent,

source§

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

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

impl<T> Deref for Node<T>
where T: NodeContent,

source§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Node<T> as Deref>::Target

Dereferences the value.
source§

impl<T> DerefMut for Node<T>
where T: NodeContent,

source§

fn deref_mut(&mut self) -> &mut <Node<T> as Deref>::Target

Mutably dereferences the value.
source§

impl<'de, T> Deserialize<'de> for Node<T>
where T: NodeContent + Deserialize<'de>,

source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Node<T>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> Display for Node<T>
where T: NodeContent + Display,

source§

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

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

impl<T> From<T> for Node<T>
where T: NodeContent,

source§

fn from(inner: T) -> Node<T>

Converts to this type from the input type.
source§

impl<T> Hash for Node<T>
where T: NodeContent + Hash,

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> NodeDisplay for Node<T>

source§

fn name() -> Option<&'static str>

Name of the syntax node’s type
source§

fn start(&self) -> Option<TextSize>

Starting position of the node
source§

fn end(&self) -> Option<TextSize>

Ending position of the node
source§

fn source_id(&self) -> Option<FileId>

Source id of the node
source§

fn display(&self) -> NodeDisplayWrapper<'_, Node<T>>

Obtain a display wrapper for the current node
source§

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

Display extra information for the node Read more
source§

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

Display the node’s children Read more
source§

impl<T> Ord for Node<T>
where T: NodeContent + Ord,

source§

fn cmp(&self, other: &Node<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T> PartialEq for Node<T>

source§

fn eq(&self, other: &Node<T>) -> 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<T> PartialOrd for Node<T>

source§

fn partial_cmp(&self, other: &Node<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T> Serialize for Node<T>

source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T> Copy for Node<T>
where T: NodeContent + Copy,

source§

impl<T> Eq for Node<T>
where T: NodeContent + Eq,