Struct yash_quote::Quoted
source · pub struct Quoted<'a> { /* private fields */ }
Expand description
Wrapper for quoting a string.
Quoted
wraps a &str
and implements Display
to produce a quoted version
of the string. The implementation prints the same result as quote
but
may be more efficient if the result is to be part of a larger string built
with a formatter.
Implementations§
Trait Implementations§
source§impl<'a> From<&'a str> for Quoted<'a>
impl<'a> From<&'a str> for Quoted<'a>
Wraps a string in Quoted
.
This function scans the string to cache the value for
Quoted::needs_quoting
, so this is an O(n) operation.
impl<'a> Copy for Quoted<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Quoted<'a>
impl<'a> Send for Quoted<'a>
impl<'a> Sync for Quoted<'a>
impl<'a> Unpin for Quoted<'a>
impl<'a> UnwindSafe for Quoted<'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