[][src]Struct cssparser::CssStringWriter

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 {
    dest.write_str("\"")?;
    {
        let mut string_dest = CssStringWriter::new(dest);
        // Write into string_dest...
    }
    dest.write_str("\"")?;
    Ok(())
}

Methods

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

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]

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

Auto Trait Implementations

impl<'a, W> Unpin for CssStringWriter<'a, W>

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

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

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

impl<'a, W> !UnwindSafe for CssStringWriter<'a, W>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]