pub struct VariableDirective {
pub attributes: Vec<AttributeDirective>,
pub modifiers: Vec<VariableModifier>,
pub ty: DataType,
pub name: VariableSymbol,
pub array_dims: Vec<Option<u64>>,
pub initializer: Option<GlobalInitializer>,
pub span: Span,
}Expand description
Module-scoped variable declaration shared by .tex, .shared, .global, and .const.
Fields§
§attributes: Vec<AttributeDirective>Example: .global .attribute(.managed) .s32 g; .global .attribute(.managed) .u64 x; .global .attribute(.unified(19,95)) .f32 f;
modifiers: Vec<VariableModifier>Modifiers applied to the variable (e.g., .v4, .align 16, .ptr).
ty: DataTypeThe data type of the variable (e.g., .s32, .f64).
name: VariableSymbolThe variable name.
array_dims: Vec<Option<u64>>The array dimensions, if any. Example: .global .s32 offset[][2] = { {-1, 0}, {0, -1}, {1, 0}, {0, 1} };
initializer: Option<GlobalInitializer>Optional global initializer for the variable.
span: SpanImplementations§
Trait Implementations§
Source§impl Clone for VariableDirective
impl Clone for VariableDirective
Source§fn clone(&self) -> VariableDirective
fn clone(&self) -> VariableDirective
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 VariableDirective
impl Debug for VariableDirective
impl Eq for VariableDirective
Source§impl PartialEq for VariableDirective
impl PartialEq for VariableDirective
Source§fn eq(&self, other: &VariableDirective) -> bool
fn eq(&self, other: &VariableDirective) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PtxParser for VariableDirective
impl PtxParser for VariableDirective
Source§fn parse() -> impl Fn(&mut PtxTokenStream<'_>) -> Result<(Self, Span), PtxParseError>
fn parse() -> impl Fn(&mut PtxTokenStream<'_>) -> Result<(Self, Span), PtxParseError>
Returns a parser function that can parse an instance of
Self.Source§impl PtxUnparser for VariableDirective
impl PtxUnparser for VariableDirective
Source§fn unparse_tokens(&self, tokens: &mut Vec<PtxToken>)
fn unparse_tokens(&self, tokens: &mut Vec<PtxToken>)
Append the PTX token sequence representing
self to tokens.Source§fn unparse_tokens_mode(&self, tokens: &mut Vec<PtxToken>, spaced: bool)
fn unparse_tokens_mode(&self, tokens: &mut Vec<PtxToken>, spaced: bool)
Append tokens, optionally inserting spacing tokens for readability.
Source§fn to_tokens(&self) -> Vec<PtxToken>
fn to_tokens(&self) -> Vec<PtxToken>
Convenience helper that returns the serialized PTX token stream.
Source§fn to_tokens_spaced(&self) -> Vec<PtxToken>
fn to_tokens_spaced(&self) -> Vec<PtxToken>
Convenience helper that returns the serialized PTX token stream with
spacing/newlines inserted for readability.
Source§impl Serialize for VariableDirective
impl Serialize for VariableDirective
Source§impl Spanned for VariableDirective
impl Spanned for VariableDirective
impl StructuralPartialEq for VariableDirective
Source§impl TreeDisplay for VariableDirective
impl TreeDisplay for VariableDirective
Source§fn tree_display(&self, f: &mut TreeFormatter, source: &str) -> Result
fn tree_display(&self, f: &mut TreeFormatter, source: &str) -> Result
Display this node in tree format. Read more
Auto Trait Implementations§
impl Freeze for VariableDirective
impl RefUnwindSafe for VariableDirective
impl Send for VariableDirective
impl Sync for VariableDirective
impl Unpin for VariableDirective
impl UnsafeUnpin for VariableDirective
impl UnwindSafe for VariableDirective
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