Struct fv_template::ct::Template
source · pub struct Template { /* private fields */ }Expand description
A compile-time field value template.
Implementations§
source§impl Template
impl Template
sourcepub fn parse2(input: TokenStream) -> Result<Self, Error>
pub fn parse2(input: TokenStream) -> Result<Self, Error>
Parse a template from a TokenStream.
The TokenStream is typically all the tokens given to a macro.
sourcepub fn before_template_field_values<'a>(
&'a self
) -> impl Iterator<Item = &'a FieldValue>
pub fn before_template_field_values<'a>( &'a self ) -> impl Iterator<Item = &'a FieldValue>
Field values that appear before the template string literal.
sourcepub fn template_field_values<'a>(
&'a self
) -> impl Iterator<Item = &'a FieldValue>
pub fn template_field_values<'a>( &'a self ) -> impl Iterator<Item = &'a FieldValue>
Field values that appear within the template string literal.
sourcepub fn after_template_field_values<'a>(
&'a self
) -> impl Iterator<Item = &'a FieldValue>
pub fn after_template_field_values<'a>( &'a self ) -> impl Iterator<Item = &'a FieldValue>
Field values that appear after the template string literal.
sourcepub fn to_rt_tokens(&self, base: TokenStream) -> TokenStream
pub fn to_rt_tokens(&self, base: TokenStream) -> TokenStream
Generate a TokenStream that constructs a runtime representation of this template.
sourcepub fn to_rt_tokens_with_visitor(
&self,
base: TokenStream,
visitor: impl Visitor
) -> TokenStream
pub fn to_rt_tokens_with_visitor( &self, base: TokenStream, visitor: impl Visitor ) -> TokenStream
Generate a TokenStream the constructs a runtime representation of this template.
The Visitor has a chance to modify fragments of the template during code generation.