Enum glsl_lang::ast::StatementData
source · pub enum StatementData {
Declaration(Node<DeclarationData>),
Expression(Node<ExprStatementData>),
Selection(Node<SelectionStatementData>),
Switch(Node<SwitchStatementData>),
CaseLabel(Node<CaseLabelData>),
Iteration(Node<IterationStatementData>),
Jump(Node<JumpStatementData>),
Compound(Node<CompoundStatementData>),
}
Expand description
Statement.
Variants§
Declaration(Node<DeclarationData>)
Declaration
Expression(Node<ExprStatementData>)
Expression statement
Selection(Node<SelectionStatementData>)
if/...
statement
Switch(Node<SwitchStatementData>)
switch
statement
CaseLabel(Node<CaseLabelData>)
Switch statement case label
Iteration(Node<IterationStatementData>)
Iteration statement
Jump(Node<JumpStatementData>)
Jump statement
Compound(Node<CompoundStatementData>)
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
) -> StatementDatawhere
T: Into<FullySpecifiedTypeData>,
N: Into<IdentifierData>,
A: Into<Option<Node<ArraySpecifierData>>>,
I: Into<Option<Node<InitializerData>>>,
pub fn declare_var<T, N, A, I>(
ty: T,
name: N,
array_specifier: A,
initializer: I
) -> StatementDatawhere
T: Into<FullySpecifiedTypeData>,
N: Into<IdentifierData>,
A: Into<Option<Node<ArraySpecifierData>>>,
I: Into<Option<Node<InitializerData>>>,
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>) -> StatementData
fn from(node: Node<StatementData>) -> StatementData
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