Trait AttributeValue

Source
pub trait AttributeValue {
    // Required method
    fn write_attribute_value(self, w: &mut impl Write) -> Result;

    // Provided method
    fn is_unit(&self) -> bool { ... }
}
Expand description

Represents a value of an attribute.

Required Methods§

Source

fn write_attribute_value(self, w: &mut impl Write) -> Result

Writes the attribute value to w.

§Arguments
  • w - The writer to write to.

Provided Methods§

Source

fn is_unit(&self) -> bool

Tells whether the attribute value is a unit value, meaning that it is not written.

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 AttributeValue for &&str

Source§

fn is_unit(&self) -> bool

Source§

fn write_attribute_value(self, w: &mut impl Write) -> Result

Source§

impl AttributeValue for &str

Source§

fn is_unit(&self) -> bool

Source§

fn write_attribute_value(self, w: &mut impl Write) -> Result

Source§

impl AttributeValue for &String

Source§

fn is_unit(&self) -> bool

Source§

fn write_attribute_value(self, w: &mut impl Write) -> Result

Source§

impl AttributeValue for ()

Source§

fn is_unit(&self) -> bool

Source§

fn write_attribute_value(self, _w: &mut impl Write) -> Result

Source§

impl AttributeValue for String

Source§

fn is_unit(&self) -> bool

Source§

fn write_attribute_value(self, w: &mut impl Write) -> Result

Implementors§