pub struct Model {
pub items: Vec<Item>,
}
Fields§
§items: Vec<Item>
Implementations§
Source§impl Model
impl Model
pub fn new() -> Self
pub fn save(&self) -> Result<(), ProjectError>
pub fn load(&mut self) -> Result<(), ProjectError>
pub fn delete_item(&mut self, item_name: &str) -> Result<(), ProjectError>
pub fn update_item( &mut self, item_name: &str, new_rules: Vec<Rule>, new_state: bool, ) -> Result<(), ProjectError>
pub fn read_item(&self, item_name: &str) -> Option<&Item>
pub fn create_item( &mut self, name: String, rules: Vec<Rule>, state: bool, ) -> Result<(), ProjectError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Model
impl<'de> Deserialize<'de> for Model
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more