pub trait ValueStore {
    // Required methods
    fn value_opt<T>(&self, id: T) -> Option<&ValueData>
       where T: Into<ValueId>;
    fn update<T, U>(&mut self, id: T, value: U) -> Option<ValueData>
       where T: Into<ValueId>,
             U: Into<ValueData>;

    // Provided methods
    fn value(&self, id: impl Into<ValueId>) -> &ValueData { ... }
    fn integer_value<T>(&self, id: T) -> Option<i64>
       where T: Into<ValueId> { ... }
    fn float_value<T>(&self, id: T) -> Option<f64>
       where T: Into<ValueId> { ... }
    fn str_value<T>(&self, id: T) -> Option<&String>
       where T: Into<ValueId> { ... }
}

Required Methods§

source

fn value_opt<T>(&self, id: T) -> Option<&ValueData>where T: Into<ValueId>,

source

fn update<T, U>(&mut self, id: T, value: U) -> Option<ValueData>where T: Into<ValueId>, U: Into<ValueData>,

Provided Methods§

source

fn value(&self, id: impl Into<ValueId>) -> &ValueData

source

fn integer_value<T>(&self, id: T) -> Option<i64>where T: Into<ValueId>,

source

fn float_value<T>(&self, id: T) -> Option<f64>where T: Into<ValueId>,

source

fn str_value<T>(&self, id: T) -> Option<&String>where T: Into<ValueId>,

Implementations on Foreign Types§

source§

impl<'a, V: 'a + ValueStore + ?Sized> ValueStore for &'a mut V

source§

fn value_opt<T>(&self, id: T) -> Option<&ValueData>where T: Into<ValueId>,

source§

fn update<T, U>(&mut self, id: T, value: U) -> Option<ValueData>where T: Into<ValueId>, U: Into<ValueData>,

source§

fn value(&self, id: impl Into<ValueId>) -> &ValueData

source§

fn integer_value<T>(&self, id: T) -> Option<i64>where T: Into<ValueId>,

source§

fn float_value<T>(&self, id: T) -> Option<f64>where T: Into<ValueId>,

source§

fn str_value<T>(&self, id: T) -> Option<&String>where T: Into<ValueId>,

source§

impl<V: ValueStore + ?Sized> ValueStore for Box<V>

source§

fn value_opt<T>(&self, id: T) -> Option<&ValueData>where T: Into<ValueId>,

source§

fn update<T, U>(&mut self, id: T, value: U) -> Option<ValueData>where T: Into<ValueId>, U: Into<ValueData>,

source§

fn value(&self, id: impl Into<ValueId>) -> &ValueData

source§

fn integer_value<T>(&self, id: T) -> Option<i64>where T: Into<ValueId>,

source§

fn float_value<T>(&self, id: T) -> Option<f64>where T: Into<ValueId>,

source§

fn str_value<T>(&self, id: T) -> Option<&String>where T: Into<ValueId>,

Implementors§