Skip to main content

Stored

Trait Stored 

Source
pub trait Stored:
    Clone
    + PartialEq
    + 'static {
    // Required methods
    fn read(defaults: &NSUserDefaults, key: &NSString) -> Option<Self>;
    fn write(&self, defaults: &NSUserDefaults, key: &NSString);
}
Expand description

A value stored can keep in user defaults.

Required Methods§

Source

fn read(defaults: &NSUserDefaults, key: &NSString) -> Option<Self>

Reads the value under key, if there is one.

Source

fn write(&self, defaults: &NSUserDefaults, key: &NSString)

Writes the value under key.

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

Source§

fn read(d: &NSUserDefaults, key: &NSString) -> Option<Self>

Source§

fn write(&self, d: &NSUserDefaults, key: &NSString)

Source§

impl Stored for bool

Source§

fn read(d: &NSUserDefaults, key: &NSString) -> Option<Self>

Source§

fn write(&self, d: &NSUserDefaults, key: &NSString)

Source§

impl Stored for f64

Source§

fn read(d: &NSUserDefaults, key: &NSString) -> Option<Self>

Source§

fn write(&self, d: &NSUserDefaults, key: &NSString)

Source§

impl Stored for i64

Source§

fn read(d: &NSUserDefaults, key: &NSString) -> Option<Self>

Source§

fn write(&self, d: &NSUserDefaults, key: &NSString)

Implementors§