ActiveRecord

Trait ActiveRecord 

Source
pub trait ActiveRecord {
    // Required methods
    fn name() -> String
       where Self: Sized;
    fn record_type() -> RecordType
       where Self: Sized;
    fn from_raw(raw: RawRecord) -> Self
       where Self: Sized;
    fn get_raw(&self) -> RawRecord;
    fn set_state(&mut self, state: &str);
    fn get_state(&self) -> Option<String>;
    fn get_record_mut(&mut self) -> RecordMut<'_>;
    fn get_children_mut(&mut self) -> BTreeMap<String, RecordMut<'_>>;
    fn get_record_ref(&self) -> RecordRef<'_>;
    fn get_children(&self) -> BTreeMap<String, RecordRef<'_>>;
}

Required Methods§

Source

fn name() -> String
where Self: Sized,

Source

fn record_type() -> RecordType
where Self: Sized,

Source

fn from_raw(raw: RawRecord) -> Self
where Self: Sized,

From raw should not fail if no State is provided even if this is a stateful object. Provide a default state in such a case

Source

fn get_raw(&self) -> RawRecord

Source

fn set_state(&mut self, state: &str)

Source

fn get_state(&self) -> Option<String>

Source

fn get_record_mut(&mut self) -> RecordMut<'_>

Source

fn get_children_mut(&mut self) -> BTreeMap<String, RecordMut<'_>>

Source

fn get_record_ref(&self) -> RecordRef<'_>

Source

fn get_children(&self) -> BTreeMap<String, RecordRef<'_>>

Implementations on Foreign Types§

Source§

impl<K, T> ActiveRecord for BTreeMap<K, T>
where K: Ord + Display + FromStr, <K as FromStr>::Err: Debug, T: ActiveRecord,

Source§

impl<T> ActiveRecord for Vec<T>
where T: ActiveRecord,

Implementors§