pub enum TemplateElement<O: SubstParseContext> {
Ident(Ident, O::NotInConcat),
LitStr(LitStr),
Literal(Lit, (<O as SubstParseContext>::NotInPaste, <O as SubstParseContext>::NotInConcat)),
Punct(Punct, (<O as SubstParseContext>::NotInPaste, <O as SubstParseContext>::NotInConcat)),
Group {
delim_span: Span,
delimiter: Delimiter,
template: Template<O>,
allow_tokens: (<O as SubstParseContext>::NotInPaste, <O as SubstParseContext>::NotInConcat),
},
Subst(Subst<O>),
Repeat(RepeatedTemplate<O>),
}Variants§
Ident(Ident, O::NotInConcat)
LitStr(LitStr)
Literal(Lit, (<O as SubstParseContext>::NotInPaste, <O as SubstParseContext>::NotInConcat))
Not used for syn::Lit::Str
Punct(Punct, (<O as SubstParseContext>::NotInPaste, <O as SubstParseContext>::NotInConcat))
Group
Fields
§
allow_tokens: (<O as SubstParseContext>::NotInPaste, <O as SubstParseContext>::NotInConcat)Subst(Subst<O>)
Might contain SD::when
Repeat(RepeatedTemplate<O>)
Trait Implementations§
Source§impl<O: SubstParseContext> AnalyseRepeat for TemplateElement<O>
impl<O: SubstParseContext> AnalyseRepeat for TemplateElement<O>
fn analyse_repeat(&self, visitor: &mut RepeatAnalysisVisitor) -> Result<()>
Source§impl<O: Debug + SubstParseContext> Debug for TemplateElement<O>where
O::NotInConcat: Debug,
impl<O: Debug + SubstParseContext> Debug for TemplateElement<O>where
O::NotInConcat: Debug,
Source§impl Expand<Accumulator> for TemplateElement<Accumulator>
impl Expand<Accumulator> for TemplateElement<Accumulator>
fn expand<'c>( &self, ctx: GeneralContext<'c>, out: &mut Accumulator, ) -> Result<()>
Source§impl Expand<TokenAccumulator> for TemplateElement<TokenAccumulator>
impl Expand<TokenAccumulator> for TemplateElement<TokenAccumulator>
fn expand<'c>( &self, ctx: GeneralContext<'c>, out: &mut TokenAccumulator, ) -> Result<()>
Source§impl<O: SubstParseContext> FindRecogMetas for TemplateElement<O>
impl<O: SubstParseContext> FindRecogMetas for TemplateElement<O>
Source§fn find_recog_metas(&self, acc: &mut Recognised)
fn find_recog_metas(&self, acc: &mut Recognised)
Search for
fmeta(..) etc. expansions Read moreSource§impl<O: SubstParseContext> Parse for TemplateElement<O>
impl<O: SubstParseContext> Parse for TemplateElement<O>
fn parse(input: ParseStream<'_>) -> Result<Self>
Auto Trait Implementations§
impl<O> Freeze for TemplateElement<O>where
<O as SubstParseContext>::NotInConcat: Freeze,
<O as SubstParseContext>::NotInPaste: Freeze,
<O as SubstParseContext>::NotInBool: Freeze,
<O as SubstParseContext>::BoolOnly: Freeze,
impl<O> RefUnwindSafe for TemplateElement<O>where
<O as SubstParseContext>::NotInConcat: RefUnwindSafe,
<O as SubstParseContext>::NotInPaste: RefUnwindSafe,
<O as SubstParseContext>::NotInBool: RefUnwindSafe,
<O as SubstParseContext>::BoolOnly: RefUnwindSafe,
<O as SubstParseContext>::DbgContent: RefUnwindSafe,
impl<O> !Send for TemplateElement<O>
impl<O> !Sync for TemplateElement<O>
impl<O> Unpin for TemplateElement<O>where
<O as SubstParseContext>::NotInConcat: Unpin,
<O as SubstParseContext>::NotInPaste: Unpin,
<O as SubstParseContext>::NotInBool: Unpin,
<O as SubstParseContext>::BoolOnly: Unpin,
impl<O> UnwindSafe for TemplateElement<O>where
<O as SubstParseContext>::NotInConcat: UnwindSafe,
<O as SubstParseContext>::NotInPaste: UnwindSafe,
<O as SubstParseContext>::NotInBool: UnwindSafe,
<O as SubstParseContext>::BoolOnly: UnwindSafe,
<O as SubstParseContext>::DbgContent: UnwindSafe,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more