[][src]Struct taskchampion::Replica

pub struct Replica { /* fields omitted */ }

A replica represents an instance of a user's task data, providing an easy interface for querying and modifying that data.

Implementations

impl Replica[src]

pub fn new(storage: Box<dyn TaskStorage>) -> Replica[src]

pub fn from_config(config: ReplicaConfig) -> Fallible<Replica>[src]

pub fn all_tasks(&mut self) -> Fallible<HashMap<Uuid, Task>>[src]

Get all tasks represented as a map keyed by UUID

pub fn all_task_uuids(&mut self) -> Fallible<Vec<Uuid>>[src]

Get the UUIDs of all tasks

pub fn working_set(&mut self) -> Fallible<Vec<Option<Task>>>[src]

Get the "working set" for this replica -- the set of pending tasks, as indexed by small integers

pub fn get_task(&mut self, uuid: &Uuid) -> Fallible<Option<Task>>[src]

Get an existing task by its UUID

pub fn get_working_set_task(&mut self, i: usize) -> Fallible<Option<Task>>[src]

Get an existing task by its working set index

pub fn get_working_set_index(&mut self, uuid: &Uuid) -> Fallible<Option<usize>>[src]

Get the working set index for the given task uuid

pub fn new_task(
    &mut self,
    status: Status,
    description: String
) -> Fallible<Task>
[src]

Create a new task. The task must not already exist.

pub fn sync(&mut self, server: &mut Box<dyn Server>) -> Fallible<()>[src]

Synchronize this replica against the given server.

pub fn gc(&mut self) -> Fallible<()>[src]

Perform "garbage collection" on this replica. In particular, this renumbers the working set to contain only pending tasks.

Auto Trait Implementations

impl !RefUnwindSafe for Replica

impl !Send for Replica

impl !Sync for Replica

impl Unpin for Replica

impl !UnwindSafe for Replica

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,