Trait fast_fmt::transform::Transform
[−]
[src]
pub trait Transform { fn transform_char<W: Write>(
&self,
writer: &mut W,
c: char
) -> Result<(), W::Error>; fn transform_size_hint(&self, bytes: usize) -> usize; fn transform_str<W: Write>(
&self,
writer: &mut W,
s: &str
) -> Result<(), W::Error> { ... } }
Represents a transformation of text to another text.
It abstracts transforming a single value and a whole input to the writer.
Required Methods
fn transform_char<W: Write>(
&self,
writer: &mut W,
c: char
) -> Result<(), W::Error>
&self,
writer: &mut W,
c: char
) -> Result<(), W::Error>
Writes transformed char into provided writer.
fn transform_size_hint(&self, bytes: usize) -> usize
Calculates new size hint based on how transformation affects output size.
It should always be maximum of possible scenarios. If maximum can't be determined, the
bytes
value should be returned unchanged.
Provided Methods
fn transform_str<W: Write>(
&self,
writer: &mut W,
s: &str
) -> Result<(), W::Error>
&self,
writer: &mut W,
s: &str
) -> Result<(), W::Error>
Writes transformed string into provided writer.
Implementors
impl<'a, T: Transform> Transform for &'a T