pub enum TextSegment {
Literal(String),
Expr(Arc<Expr>),
}Expand description
One segment of text that may contain {expr} fragments.
Line text, option text, line-variant text, and command argument strings are
all stored as Vec<TextSegment> so that {expr} fragments are parsed once
at compile time and evaluated cheaply at runtime.
Variants§
Literal(String)
A literal string with no interpolation.
Expr(Arc<Expr>)
An {expr} fragment whose source has already been parsed.
Implementations§
Trait Implementations§
Source§impl Clone for TextSegment
impl Clone for TextSegment
Source§fn clone(&self) -> TextSegment
fn clone(&self) -> TextSegment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TextSegment
impl RefUnwindSafe for TextSegment
impl Send for TextSegment
impl Sync for TextSegment
impl Unpin for TextSegment
impl UnsafeUnpin for TextSegment
impl UnwindSafe for TextSegment
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