Struct glsl_lang::ast::Node [−][src]
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]
T: NodeContent,
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]
U: NodeContent,
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]
U: NodeContent,
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]
T: Clone + NodeContent,
impl<T> Copy for Node<T> where
T: NodeContent + Copy,
[src]
T: NodeContent + Copy,
impl<T> Debug for Node<T> where
T: Debug + NodeContent,
[src]
T: Debug + NodeContent,
impl<T> Deref for Node<T> where
T: NodeContent,
[src]
T: NodeContent,
type Target = T
The resulting type after dereferencing.
pub fn deref(&self) -> &<Node<T> as Deref>::Target
[src]
impl<T> DerefMut for Node<T> where
T: NodeContent,
[src]
T: NodeContent,
impl<T> Display for Node<T> where
T: NodeContent + Display,
[src]
T: NodeContent + Display,
impl From<Node<TypeNameData>> for TypeSpecifierNonArray
[src]
impl<T> From<T> for Node<T> where
T: NodeContent,
[src]
T: NodeContent,
impl FromIterator<Node<StatementData>> for CompoundStatementData
[src]
fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = Statement>,
[src]
T: IntoIterator<Item = Statement>,
impl<T> NodeContentEq for Node<T> where
T: NodeContent + NodeContentEq,
[src]
T: NodeContent + NodeContentEq,
pub fn content_eq(&self, other: &Node<T>) -> bool
[src]
impl<T> NodeDisplay for Node<T> where
T: NodeContentDisplay + NodeContent,
[src]
T: NodeContentDisplay + NodeContent,
pub fn name() -> Option<&'static str>
[src]
pub fn start(&self) -> Option<usize>
[src]
pub fn end(&self) -> Option<usize>
[src]
pub fn source_id(&self) -> Option<usize>
[src]
pub fn display(&self) -> NodeDisplayWrapper<'_, Node<T>>
[src]
pub fn display_extra(&self, f: &mut Formatter<'_>) -> Result<(), Error>
[src]
pub fn display_children(
&self,
level: usize,
f: &mut Formatter<'_>
) -> Result<(), Error>
[src]
&self,
level: usize,
f: &mut Formatter<'_>
) -> Result<(), Error>
impl<T> PartialEq<Node<T>> for Node<T> where
T: PartialEq<T> + NodeContent,
[src]
T: PartialEq<T> + NodeContent,
impl<T> StructuralPartialEq for Node<T> where
T: NodeContent,
[src]
T: NodeContent,
Auto Trait Implementations
impl<T> RefUnwindSafe for Node<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Node<T> where
T: Send,
T: Send,
impl<T> Sync for Node<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Node<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Node<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
type Err = Infallible
pub fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,