pub trait PtxUnparser {
// Required method
fn unparse_tokens(&self, tokens: &mut Vec<PtxToken>);
// Provided methods
fn unparse_tokens_mode(&self, tokens: &mut Vec<PtxToken>, spaced: bool) { ... }
fn to_tokens(&self) -> Vec<PtxToken> { ... }
fn to_tokens_spaced(&self) -> Vec<PtxToken> { ... }
}Expand description
Trait that mirrors crate::parser::PtxParser but for emitting PTX source
text from the structured representation.
Required Methods§
Sourcefn unparse_tokens(&self, tokens: &mut Vec<PtxToken>)
fn unparse_tokens(&self, tokens: &mut Vec<PtxToken>)
Append the PTX token sequence representing self to tokens.
Provided Methods§
Sourcefn 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.
Sourcefn to_tokens(&self) -> Vec<PtxToken>
fn to_tokens(&self) -> Vec<PtxToken>
Convenience helper that returns the serialized PTX token stream.
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".