Struct cssparser::CssStringWriter[][src]

pub struct CssStringWriter<'a, W> { /* fields omitted */ }
Expand description

A fmt::Write adapter that escapes text for writing as a double-quoted CSS string. Quotes are not included.

Typical usage:

fn write_foo<W>(foo: &Foo, dest: &mut W) -> fmt::Result where W: fmt::Write {
    dest.write_str("\"")?;
    {
        let mut string_dest = CssStringWriter::new(dest);
        // Write into string_dest...
    }
    dest.write_str("\"")?;
    Ok(())
}

Implementations

Wrap a text writer to create a CssStringWriter.

Trait Implementations

Writes a string slice 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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.