Skip to main content

ThingsStore

Struct ThingsStore 

Source
pub struct ThingsStore {
    pub tasks_by_uuid: HashMap<ThingsId, Task>,
    pub areas_by_uuid: HashMap<ThingsId, Area>,
    pub tags_by_uuid: HashMap<ThingsId, Tag>,
    pub tags_by_title: HashMap<String, ThingsId>,
    pub project_progress_by_uuid: HashMap<ThingsId, ProjectProgress>,
    pub short_ids: HashMap<ThingsId, String>,
    pub markable_ids: HashSet<ThingsId>,
    pub markable_ids_sorted: Vec<ThingsId>,
    pub area_ids_sorted: Vec<ThingsId>,
    pub task_ids_sorted: Vec<ThingsId>,
}

Fields§

§tasks_by_uuid: HashMap<ThingsId, Task>§areas_by_uuid: HashMap<ThingsId, Area>§tags_by_uuid: HashMap<ThingsId, Tag>§tags_by_title: HashMap<String, ThingsId>§project_progress_by_uuid: HashMap<ThingsId, ProjectProgress>§short_ids: HashMap<ThingsId, String>§markable_ids: HashSet<ThingsId>§markable_ids_sorted: Vec<ThingsId>§area_ids_sorted: Vec<ThingsId>§task_ids_sorted: Vec<ThingsId>

Implementations§

Source§

impl ThingsStore

Source

pub fn from_raw_state(raw_state: &RawState) -> Self

Source

pub fn tasks( &self, status: Option<TaskStatus>, trashed: Option<bool>, item_type: Option<TaskType>, ) -> Vec<Task>

Source

pub fn today(&self, today: &DateTime<Utc>) -> Vec<Task>

Source

pub fn inbox(&self) -> Vec<Task>

Source

pub fn anytime(&self, today: &DateTime<Utc>) -> Vec<Task>

Source

pub fn someday(&self) -> Vec<Task>

Source

pub fn logbook( &self, from_date: Option<DateTime<Local>>, to_date: Option<DateTime<Local>>, ) -> Vec<Task>

Source

pub fn effective_project_uuid(&self, task: &Task) -> Option<ThingsId>

Source

pub fn effective_area_uuid(&self, task: &Task) -> Option<ThingsId>

Source

pub fn projects(&self, status: Option<TaskStatus>) -> Vec<Task>

Source

pub fn areas(&self) -> Vec<Area>

Source

pub fn tags(&self) -> Vec<Tag>

Source

pub fn get_task(&self, uuid: &str) -> Option<Task>

Source

pub fn get_area(&self, uuid: &str) -> Option<Area>

Source

pub fn get_tag(&self, uuid: &str) -> Option<Tag>

Source

pub fn resolve_tag_title<T: ToString>(&self, uuid: T) -> String

Source

pub fn resolve_area_title<T: ToString>(&self, uuid: T) -> String

Source

pub fn resolve_project_title<T: ToString>(&self, uuid: T) -> String

Source

pub fn short_id<T: ToString>(&self, uuid: T) -> String

Source

pub fn project_progress<T: ToString>(&self, project_uuid: T) -> ProjectProgress

Source

pub fn unique_prefix_length<T: ToString>(&self, ids: &[T]) -> usize

Source

pub fn resolve_mark_identifier( &self, identifier: &str, ) -> (Option<Task>, String, Vec<Task>)

Source

pub fn resolve_area_identifier( &self, identifier: &str, ) -> (Option<Area>, String, Vec<Area>)

Source

pub fn resolve_task_identifier( &self, identifier: &str, ) -> (Option<Task>, String, Vec<Task>)

Trait Implementations§

Source§

impl Debug for ThingsStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ThingsStore

Source§

fn default() -> ThingsStore

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more