Struct cssparser::CssStringWriter
source · pub struct CssStringWriter<'a, W> {
inner: &'a mut W,
}
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(())
}
Fields§
§inner: &'a mut W
Implementations§
source§impl<'a, W> CssStringWriter<'a, W>where
W: Write,
impl<'a, W> CssStringWriter<'a, W>where
W: Write,
sourcepub fn new(inner: &'a mut W) -> CssStringWriter<'a, W>
pub fn new(inner: &'a mut W) -> CssStringWriter<'a, W>
Wrap a text writer to create a CssStringWriter
.
Trait Implementations§
Auto Trait Implementations§
impl<'a, W> Freeze for CssStringWriter<'a, W>
impl<'a, W> RefUnwindSafe for CssStringWriter<'a, W>where
W: RefUnwindSafe,
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> Unpin for CssStringWriter<'a, W>
impl<'a, W> !UnwindSafe for CssStringWriter<'a, W>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more