pub struct Output { /* private fields */ }Expand description
The result of rendering an element or expanding a template.
Holds both the generated token output and any accumulated diagnostics.
Implements ToTokens by emitting the tokens followed by any diagnostic
compiler messages, preserving the same behavior as the previous TokenStream
return type.
Implementations§
Source§impl Output
impl Output
Sourcepub fn new() -> OutputBuilder
pub fn new() -> OutputBuilder
Creates a new OutputBuilder.
Sourcepub fn tokens(&self) -> &TokenStream
pub fn tokens(&self) -> &TokenStream
Returns the generated token output.
Sourcepub fn diagnostic(&self) -> &Diagnostic
pub fn diagnostic(&self) -> &Diagnostic
Returns the accumulated diagnostic.
Sourcepub fn into_parts(self) -> (TokenStream, Diagnostic)
pub fn into_parts(self) -> (TokenStream, Diagnostic)
Consumes the output and returns its tokens and diagnostic.
Methods from Deref<Target = TokenStream>§
Trait Implementations§
Source§impl From<Diagnostic> for Output
impl From<Diagnostic> for Output
Source§fn from(diagnostic: Diagnostic) -> Self
fn from(diagnostic: Diagnostic) -> Self
Converts to this type from the input type.
Source§impl From<Output> for Diagnostic
impl From<Output> for Diagnostic
Source§impl From<Output> for OutputBuilder
impl From<Output> for OutputBuilder
Source§impl From<Output> for TokenStream
impl From<Output> for TokenStream
Source§impl From<TokenStream> for Output
impl From<TokenStream> for Output
Source§fn from(tokens: TokenStream) -> Self
fn from(tokens: TokenStream) -> Self
Converts to this type from the input type.
Source§impl ToTokens for Output
impl ToTokens for Output
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for Output
impl RefUnwindSafe for Output
impl !Send for Output
impl !Sync for Output
impl Unpin for Output
impl UnsafeUnpin for Output
impl UnwindSafe for Output
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§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.