Enum glsl_lang_types::ast::StatementData
source · pub enum StatementData {
Declaration(Declaration),
Expression(ExprStatement),
Selection(SelectionStatement),
Switch(SwitchStatement),
CaseLabel(CaseLabel),
Iteration(IterationStatement),
Jump(JumpStatement),
Compound(CompoundStatement),
}Expand description
Statement.
Variants§
Declaration(Declaration)
Declaration
Expression(ExprStatement)
Expression statement
Selection(SelectionStatement)
if/... statement
Switch(SwitchStatement)
switch statement
CaseLabel(CaseLabel)
Switch statement case label
Iteration(IterationStatement)
Iteration statement
Jump(JumpStatement)
Jump statement
Compound(CompoundStatement)
Statement block
Implementations§
source§impl StatementData
impl StatementData
sourcepub fn declare_var<T, N, A, I>(
ty: T,
name: N,
array_specifier: A,
initializer: I
) -> Selfwhere
T: Into<FullySpecifiedTypeData>,
N: Into<IdentifierData>,
A: Into<Option<ArraySpecifier>>,
I: Into<Option<Initializer>>,
pub fn declare_var<T, N, A, I>( ty: T, name: N, array_specifier: A, initializer: I ) -> Selfwhere T: Into<FullySpecifiedTypeData>, N: Into<IdentifierData>, A: Into<Option<ArraySpecifier>>, I: Into<Option<Initializer>>,
Declare a new variable.
ty is the type of the variable, name the name of the binding to create,
array_specifier an optional argument to make your binding an array and
initializer
Trait Implementations§
source§impl Clone for StatementData
impl Clone for StatementData
source§fn clone(&self) -> StatementData
fn clone(&self) -> StatementData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for StatementData
impl Debug for StatementData
source§impl From<Node<StatementData>> for StatementData
impl From<Node<StatementData>> for StatementData
source§fn from(node: Node<StatementData>) -> Self
fn from(node: Node<StatementData>) -> Self
Converts to this type from the input type.
source§impl NodeContent for StatementData
impl NodeContent for StatementData
source§fn into_node<T>(self) -> Node<T>where
T: From<Self> + NodeContent,
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>
fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>
Add span information to a syntax node
source§impl NodeContentDisplay for StatementData
impl NodeContentDisplay for StatementData
source§impl PartialEq for StatementData
impl PartialEq for StatementData
source§fn eq(&self, other: &StatementData) -> bool
fn eq(&self, other: &StatementData) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for StatementData
Auto Trait Implementations§
impl RefUnwindSafe for StatementData
impl Send for StatementData
impl Sync for StatementData
impl Unpin for StatementData
impl UnwindSafe for StatementData
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more