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]

Wrap a text writer to create a CssStringWriter.

Trait Implementations

impl<'a, W> Write for CssStringWriter<'a, W> where
    W: Write
[src]

Writes a slice of bytes into this writer, returning whether the write succeeded. Read more

Writes a [char] into this writer, returning whether the write succeeded. Read more

Glue for usage of the [write!] macro with implementors of this trait. Read more

Auto Trait Implementations

impl<'a, W> Send for CssStringWriter<'a, W> where
    W: Send

impl<'a, W> Sync for CssStringWriter<'a, W> where
    W: Sync