Skip to main content

PrefValue

Trait PrefValue 

Source
pub trait PrefValue:
    Clone
    + PartialEq
    + 'static {
    // Required methods
    fn encode(&self) -> String;
    fn decode(s: &str) -> Option<Self>;
}
Expand description

A value a Pref can hold: encoded to one string in the store and back. Implemented for the plain scalars and strings; enums get it from pref_enum!.

Required Methods§

Source

fn encode(&self) -> String

Source

fn decode(s: &str) -> Option<Self>

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 PrefValue for String

Source§

impl PrefValue for bool

Source§

impl PrefValue for f64

Source§

impl PrefValue for i32

Source§

impl PrefValue for i64

Source§

impl PrefValue for u32

Source§

impl PrefValue for u64

Implementors§