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
sourceimpl StatementData
impl StatementData
sourcepub fn declare_var<T, N, A, I>(
ty: T,
name: N,
array_specifier: A,
initializer: I
) -> StatementData where
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
) -> StatementData where
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
sourceimpl Clone for StatementData
impl Clone for StatementData
sourcefn clone(&self) -> StatementData
fn clone(&self) -> StatementData
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for StatementData
impl Debug for StatementData
sourceimpl From<Node<StatementData>> for StatementData
impl From<Node<StatementData>> for StatementData
sourcefn from(node: Node<StatementData>) -> StatementData
fn from(node: Node<StatementData>) -> StatementData
Converts to this type from the input type.
sourceimpl NodeContent for StatementData
impl NodeContent for StatementData
sourcefn 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
sourcefn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>
fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>
Add span information to a syntax node
sourceimpl NodeContentDisplay for StatementData
impl NodeContentDisplay for StatementData
sourceimpl PartialEq<StatementData> for StatementData
impl PartialEq<StatementData> for StatementData
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &StatementData) -> bool
fn ne(&self, other: &StatementData) -> bool
This method tests for !=
.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> NodeDisplay for T where
T: NodeContentDisplay,
impl<T> NodeDisplay for T where
T: NodeContentDisplay,
sourcefn display(&self) -> NodeDisplayWrapper<'_, T>
fn display(&self) -> NodeDisplayWrapper<'_, T>
Obtain a display wrapper for the current node