pub struct Text<'a> { /* private fields */ }Expand description
A text fragment in a template.
Implementations§
Source§impl<'a> Text<'a>
impl<'a> Text<'a>
Sourcepub fn get(&self) -> &str
pub fn get(&self) -> &str
Get the value of the text fragment.
Any {{ or }} escape sequences will be replaced by raw { and }.
The Text::needs_escaping method will return true if any escape sequences were present.
Sourcepub fn needs_escaping(&self) -> bool
pub fn needs_escaping(&self) -> bool
Whether the original text fragment contained {{ or }} escape sequences.
If this method returns true, then any { and } in the value of Text::get will need to
be re-escaped to roundtrip the fragment.
Auto Trait Implementations§
impl<'a> Freeze for Text<'a>
impl<'a> RefUnwindSafe for Text<'a>
impl<'a> Send for Text<'a>
impl<'a> Sync for Text<'a>
impl<'a> Unpin for Text<'a>
impl<'a> UnsafeUnpin for Text<'a>
impl<'a> UnwindSafe for Text<'a>
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