Trait libmedium::units::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.

Object Safety§

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§