Trait Raw

Source
pub trait Raw: Sized {
    // Required methods
    fn from_raw(raw: &str) -> Result<Self, Error>;
    fn to_raw(&self) -> Cow<'_, str>;
}
Expand description

Trait that needs to be implemented by all types that raw sensor strings should be converted into.

Required Methods§

Source

fn from_raw(raw: &str) -> Result<Self, Error>

Converts a raw sensor string into a usable type.

Source

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

Converts self into a writeable raw sensor string.

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 Raw for bool

Source§

fn from_raw(raw: &str) -> Result<Self, Error>

Source§

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

Source§

impl Raw for String

Source§

fn from_raw(raw: &str) -> Result<Self, Error>

Source§

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

Source§

impl Raw for Duration

Source§

fn from_raw(raw: &str) -> Result<Self, Error>

Source§

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

Implementors§