Skip to main content

PropertyValue

Trait PropertyValue 

Source
pub trait PropertyValue: Sealed {
    // 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 sealed: a deferred log message is rebuilt from property_value() while the local sink prints the value with Display, so every impl must produce the same text for both.

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§