pub enum Span<T, A> {
Text(T),
Expr(A),
}Expand description
A component of a template, either text or an expression.
A μfmt template is internally represented as a list of Spans. Spans are parsed
deterministically according to precise breaking rules.
There are two ways to access the spans associated with a template:
- From a
Templateusing theTemplate::spansmethod - As an iterator over the spans of a template string using
TemplateSpans.
See the TemplateSpans documentation for more detail and examples.
Variants§
Implementations§
Trait Implementations§
Source§impl<T, A> FromIterator<Span<T, A>> for Template<T, A>
impl<T, A> FromIterator<Span<T, A>> for Template<T, A>
impl<T, A> StructuralPartialEq for Span<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for Span<T, A>
impl<T, A> RefUnwindSafe for Span<T, A>where
T: RefUnwindSafe,
A: RefUnwindSafe,
impl<T, A> Send for Span<T, A>
impl<T, A> Sync for Span<T, A>
impl<T, A> Unpin for Span<T, A>
impl<T, A> UnwindSafe for Span<T, A>where
T: UnwindSafe,
A: 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