Trait DataType

Source
pub trait DataType<T>: Display + TryInto<T> {
    // Required methods
    fn value(&self) -> Result<T>;
    fn as_str(&self) -> Result<&str>;
    fn as_str_lossy(&self) -> Cow<'_, str>;
    fn raw(&self) -> &[u8] ;
}

Required Methods§

Source

fn value(&self) -> Result<T>

Get the actual value that the inner byte slice is representing.

Source

fn as_str(&self) -> Result<&str>

Get the value as a raw string, before actual parsing.

Source

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

Get the value as a raw string in lossless fashion, before actual parsing.

Source

fn raw(&self) -> &[u8]

The raw slice that represents the data.

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.

Implementors§