Struct cssparser::CssStringWriter
[−]
[src]
pub struct CssStringWriter<'a, W: 'a> { /* fields omitted */ }A fmt::Write adapter that escapes text for writing as a double-quoted CSS string.
Quotes are not included.
Typical usage:
ⓘThis example is not tested
fn write_foo<W>(foo: &Foo, dest: &mut W) -> fmt::Result where W: fmt::Write { try!(dest.write_str("\"")); { let mut string_dest = CssStringWriter::new(dest); // Write into string_dest... } try!(dest.write_str("\"")); Ok(()) }
Methods
impl<'a, W> CssStringWriter<'a, W> where
W: Write, [src]
W: Write,
pub fn new(inner: &'a mut W) -> CssStringWriter<'a, W>[src]
Wrap a text writer to create a CssStringWriter.
Trait Implementations
impl<'a, W> Write for CssStringWriter<'a, W> where
W: Write, [src]
W: Write,
fn write_str(&mut self, s: &str) -> Result[src]
Writes a slice of bytes into this writer, returning whether the write succeeded. Read more
fn write_char(&mut self, c: char) -> Result<(), Error>1.1.0[src]
Writes a [char] into this writer, returning whether the write succeeded. Read more
fn write_fmt(&mut self, args: Arguments) -> Result<(), Error>1.0.0[src]
Glue for usage of the [write!] macro with implementors of this trait. Read more