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§
fn name() -> Stringwhere
Self: Sized,
fn record_type() -> RecordTypewhere
Self: Sized,
Sourcefn from_raw(raw: RawRecord) -> Selfwhere
Self: Sized,
fn from_raw(raw: RawRecord) -> Selfwhere
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