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<'de> Deserialize<'de> for StatementData
impl<'de> Deserialize<'de> for StatementData
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StatementData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StatementData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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§impl Serialize for StatementData
impl Serialize for StatementData
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
impl StructuralPartialEq for StatementData
Auto Trait Implementations§
impl Freeze for StatementData
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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