Trait ToCss

Source
pub trait ToCss {
    // Required method
    fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
       where W: Write;

    // Provided method
    fn to_css_string(&self) -> String { ... }
}
Expand description

Trait for things the can serialize themselves in CSS syntax.

Required Methods§

Source

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Serialize self in CSS syntax, writing to dest.

Provided Methods§

Source

fn to_css_string(&self) -> String

Serialize self in CSS syntax and return a string.

(This is a convenience wrapper for to_css and probably should not be overridden.)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ToCss for AttrSelectorOperator

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for Combinator

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for f32

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for f64

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for i8

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for i16

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for i32

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for i64

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for u8

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for u16

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for u32

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl ToCss for u64

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl<Impl> ToCss for Component<Impl>
where Impl: SelectorImpl,

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl<Impl> ToCss for AttrSelectorWithOptionalNamespace<Impl>
where Impl: SelectorImpl,

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl<Impl> ToCss for LocalName<Impl>
where Impl: SelectorImpl,

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl<Impl> ToCss for Selector<Impl>
where Impl: SelectorImpl,

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Source§

impl<Impl> ToCss for SelectorList<Impl>
where Impl: SelectorImpl,

Source§

fn to_css<W>(&self, dest: &mut W) -> Result<(), Error>
where W: Write,

Implementors§