Skip to main content

Readable

Trait Readable 

Source
pub trait Readable<T: ValueType>: Sized {
    // Required method
    fn read(value: &PropertyValue) -> Option<Self>;
}
Expand description

A Rust value that can be read back from a property of value type T.

§Performance

Readable::read is O(1) except for text (O(value length) to copy).

Required Methods§

Source

fn read(value: &PropertyValue) -> Option<Self>

Reads Self from a PropertyValue, or None on a type mismatch or out-of-range narrowing.

§Performance

This function is O(1) except for text (O(value length)).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Readable<Bool> for bool

Source§

fn read(value: &PropertyValue) -> Option<Self>

Source§

impl Readable<Int> for i64

Source§

fn read(value: &PropertyValue) -> Option<Self>

Source§

impl Readable<Int> for usize

Source§

fn read(value: &PropertyValue) -> Option<Self>

Source§

impl Readable<Text> for String

Source§

fn read(value: &PropertyValue) -> Option<Self>

Implementors§