#[repr(transparent)]pub struct Formatter<'a>(_);
Expand description
The type passed between calls to Quote::escape
.
All methods of this struct are defined to ensure that strings are quoted
uniformly. However, it is usually sufficient to pass this struct to the
Quote::escape
implementation of another type.
Safety
Although this type is annotated with #[repr(transparent)]
, the inner
representation is not stable. Transmuting between this type and any other
causes immediate undefined behavior.
Implementations§
source§impl<'a> Formatter<'a>
impl<'a> Formatter<'a>
sourcepub fn escape_utf16<I>(&mut self, iter: I) -> Resultwhere
I: IntoIterator<Item = u16>,
pub fn escape_utf16<I>(&mut self, iter: I) -> Resultwhere I: IntoIterator<Item = u16>,
Provides an implementation of Quote::escape
for a UTF-16 string
iterator.
The iterator does not need to contain valid UTF-16, since invalid sequences will be escaped.