pub struct Model {
pub sync_token: String,
pub items: Vec<Item>,
pub projects: Vec<Project>,
pub sections: Vec<Section>,
pub user: User,
pub commands: Vec<Command>,
}Fields§
§sync_token: String§items: Vec<Item>§projects: Vec<Project>§sections: Vec<Section>§user: User§commands: Vec<Command>Implementations§
Source§impl Model
impl Model
pub fn add_item(&mut self, item: &str, project_id: Id, due_date: Option<Due>)
pub fn add_item_to_inbox(&mut self, item: &str, due_date: Option<Due>)
Sourcepub fn mark_item(&mut self, item_id: &Id, complete: bool)
pub fn mark_item(&mut self, item_id: &Id, complete: bool)
Marks an item as complete (or uncomplete) and creates (removes) a corresponding command
§Note
This no-ops if an item with the given id does not exist, so check before calling.
pub fn get_inbox_items(&self, filter_complete: bool) -> Vec<&Item>
pub fn get_items_in_project(&self, project_id: &Id) -> Vec<&Item>
pub fn projects(&self) -> Vec<&Project>
pub fn project_with_id(&self, id: &Id) -> Option<&Project>
pub fn update(&mut self, response: Response)
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more