Skip to main content

PropertyValue

Trait PropertyValue 

Source
pub trait PropertyValue {
    // Required method
    fn property_value(&self) -> Cow<'_, str>;
}
Expand description

A value that can be recorded as a property without being formatted first.

Strings borrow, so a bare value costs no allocation. Use %value (Display) or ?value (Debug) for anything else. The trait is deliberately owned by this crate: integer and bool impls can be added later without breaking callers, since downstream crates can’t implement it for foreign types.

Required Methods§

Source

fn property_value(&self) -> Cow<'_, str>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PropertyValue for Cow<'_, str>

Source§

fn property_value(&self) -> Cow<'_, str>

Source§

impl PropertyValue for String

Source§

fn property_value(&self) -> Cow<'_, str>

Source§

impl PropertyValue for str

Source§

fn property_value(&self) -> Cow<'_, str>

Source§

impl<T> PropertyValue for &T
where T: PropertyValue + ?Sized,

Source§

fn property_value(&self) -> Cow<'_, str>

Source§

impl<T> PropertyValue for Arc<T>
where T: PropertyValue + ?Sized,

Source§

fn property_value(&self) -> Cow<'_, str>

Source§

impl<T> PropertyValue for Box<T>
where T: PropertyValue + ?Sized,

Source§

fn property_value(&self) -> Cow<'_, str>

Source§

impl<T> PropertyValue for Rc<T>
where T: PropertyValue + ?Sized,

Source§

fn property_value(&self) -> Cow<'_, str>

Implementors§