pub struct Template {
pub nodes: Vec<Node>,
}Expand description
A parsed template AST. Created by parsing template syntax via syn::parse2::<Template>(tokens).
Fields§
§nodes: Vec<Node>Implementations§
Source§impl Template
impl Template
Sourcepub fn span(&self) -> Span
pub fn span(&self) -> Span
Returns the source span of the first node, or Span::call_site() if empty.
Sourcepub fn to_token_stream(&self) -> TokenStream
pub fn to_token_stream(&self) -> TokenStream
Expands the template into a TokenStream without an Input binding.
Sourcepub fn render(&self, input: &Input) -> TokenStream
pub fn render(&self, input: &Input) -> TokenStream
Expands the template with the given Input bound as input in the generated code.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl !Send for Template
impl !Sync for Template
impl Unpin for Template
impl UnsafeUnpin for Template
impl UnwindSafe for Template
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