Struct rustorm::dao::Dao [] [src]

pub struct Dao {
    pub values: BTreeMap<String, Value>,
}

TODO: optimization, used enum types for the key values This will save allocation of string to enum keys which is a few bytes, int

Fields

values

Methods

impl Dao

fn new() -> Self

fn set(&mut self, column: &str, value: &ToValue)

fn set_null(&mut self, column: &str)

set to null the value of this column

fn set_value(&mut self, column: &str, value: Value)

fn get_value(&self, column: &str) -> Value

fn remove<T>(&mut self, column: &str) -> T where T: FromValue

take the value and remove the content

fn get<T>(&self, column: &str) -> T where T: FromValue

take the value but not removing the content

fn get_opt<T>(&self, column: &str) -> Option<T> where T: FromValue

get optional value

fn as_ref(&self, column: &str) -> &Value

get a reference of the type

fn as_map(&self) -> &BTreeMap<String, Value>

Trait Implementations

impl Encodable for Dao

custom Encoder for Dao, decodes directly the content of values, instead of values as field of this Dao struct

fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>

impl ToJson for Dao

fn to_json(&self) -> Json

Derived Implementations

impl Clone for Dao

fn clone(&self) -> Dao

fn clone_from(&mut self, source: &Self)

impl Debug for Dao

fn fmt(&self, __arg_0: &mut Formatter) -> Result