Struct glsl_lang::ast::TranslationUnit

source ·
pub struct TranslationUnit(pub Vec<Node<ExternalDeclarationData>>);
Expand description

Starting rule.

Tuple Fields§

§0: Vec<Node<ExternalDeclarationData>>

Trait Implementations§

source§

impl Clone for TranslationUnit

source§

fn clone(&self) -> TranslationUnit

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 Debug for TranslationUnit

source§

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

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

impl<'de> Deserialize<'de> for TranslationUnit

source§

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

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

impl Extractable<TranslationUnit> for ArraySpecifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for ArraySpecifierDimension

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for ArrayedIdentifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for AssignmentOp

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for CaseLabel

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for CompoundStatement

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for Declaration

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for Expr

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for ExprStatement

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for FullySpecifiedType

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for FunIdentifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for FunctionDefinition

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for InterpolationQualifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for IterationStatement

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for JumpStatement

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for LayoutQualifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for PrecisionQualifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for Preprocessor

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for SelectionStatement

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for Statement

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for StorageQualifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for StructFieldSpecifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for StructSpecifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for SwitchStatement

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for TypeQualifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for TypeSpecifier

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for TypeSpecifierNonArray

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for UnaryOp

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(ast::TranslationUnit: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl Extractable<TranslationUnit> for TranslationUnit

source§

fn wrap(source: &str) -> Cow<'_, str>

Wrap the given source which parses as Self into something that parses as R
source§

fn extract(tu: TranslationUnit) -> Option<Self>

Extract the subtree for Self from a parent tree R
source§

impl HasParser for TranslationUnit

source§

type Parser = TranslationUnitParser

Type of the parser to create
source§

impl Host for TranslationUnit

source§

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

Visit an AST node.
source§

impl HostMut for TranslationUnit

source§

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

Visit an AST node.
source§

impl NodeContent for TranslationUnit

source§

fn into_node<T>(self) -> Node<T>
where T: From<Self> + NodeContent,

Convert the contents into a node
source§

fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>

Add span information to a syntax node
source§

impl NodeContentDisplay for TranslationUnit

source§

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

Name of the node Read more
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 PartialEq for TranslationUnit

source§

fn eq(&self, other: &TranslationUnit) -> 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 Serialize for TranslationUnit

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 StructuralPartialEq for TranslationUnit

Auto Trait Implementations§

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DefaultParse for T
where T: Parse,

source§

fn parse<'i>( source: <Lexer<'i> as LangLexer<'i>>::Input, ) -> Result<T, Located<ParseErrorKind<<<Lexer<'i> as LangLexer<'i>>::Iter as HasLexerError>::Error>>>

Parse the input source
source§

fn parse_with_options<'i>( source: <Lexer<'i> as LangLexer<'i>>::Input, opts: &ParseOptions, ) -> Result<(T, ParseContext, <Lexer<'i> as LangLexer<'i>>::Iter), Located<ParseErrorKind<<<Lexer<'i> as LangLexer<'i>>::Iter as HasLexerError>::Error>>>

Parse the input source with the given options
source§

fn parse_with_context<'i>( source: <Lexer<'i> as LangLexer<'i>>::Input, ctx: &ParseContext, ) -> Result<(T, ParseContext, <Lexer<'i> as LangLexer<'i>>::Iter), Located<ParseErrorKind<<<Lexer<'i> as LangLexer<'i>>::Iter as HasLexerError>::Error>>>

Parse the input source with the given context
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> NodeDisplay for 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<'_, 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> Parsable for T

source§

fn parse_with_options<'i>( source: &'i str, opts: &ParseOptions, ) -> Result<(T, ParseContext), Located<ParseErrorKind<<Lexer<'i> as HasLexerError>::Error>>>

Parse the input source with the given options
source§

fn parse_with_context<'i>( source: &'i str, ctx: &ParseContext, ) -> Result<(T, ParseContext), Located<ParseErrorKind<<Lexer<'i> as HasLexerError>::Error>>>

Parse the input source with the given context
source§

fn parse( source: &str, ) -> Result<Self, ParseError<<DefaultLexer<'_> as HasLexerError>::Error>>

Parse the input source
source§

impl<T> Parse for T
where T: HasParser,

source§

fn parse<'i, L>( source: <L as LangLexer<'i>>::Input, ) -> Result<T, Located<ParseErrorKind<<<L as LangLexer<'i>>::Iter as HasLexerError>::Error>>>
where L: LangLexer<'i>,

Parse the input source
source§

fn parse_with_options<'i, L>( source: <L as LangLexer<'i>>::Input, opts: &ParseOptions, ) -> Result<(T, ParseContext, <L as LangLexer<'i>>::Iter), Located<ParseErrorKind<<<L as LangLexer<'i>>::Iter as HasLexerError>::Error>>>
where L: LangLexer<'i>,

Parse the input source with the given options
source§

fn parse_with_context<'i, L>( source: <L as LangLexer<'i>>::Input, ctx: &ParseContext, ) -> Result<(T, ParseContext, <L as LangLexer<'i>>::Iter), Located<ParseErrorKind<<<L as LangLexer<'i>>::Iter as HasLexerError>::Error>>>
where L: LangLexer<'i>,

Parse the input source with the given context
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,