mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
bits of docs
This commit is contained in:
parent
8601c0cb67
commit
de03209285
3 changed files with 16 additions and 1 deletions
|
@ -18,7 +18,7 @@ The [`server`](crate::server) module defines the interface a server must meet.
|
||||||
|
|
||||||
# See Also
|
# See Also
|
||||||
|
|
||||||
See the [TaskChampion Book](https://github.com/djmitche/taskchampion/blob/main/docs/src/SUMMARY.md)
|
See the [TaskChampion Book](http://djmitche.github.com/taskchampion)
|
||||||
for more information about the design and usage of the tool.
|
for more information about the design and usage of the tool.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,6 +12,18 @@ use uuid::Uuid;
|
||||||
|
|
||||||
/// A replica represents an instance of a user's task data, providing an easy interface
|
/// A replica represents an instance of a user's task data, providing an easy interface
|
||||||
/// for querying and modifying that data.
|
/// for querying and modifying that data.
|
||||||
|
///
|
||||||
|
/// ## Tasks
|
||||||
|
///
|
||||||
|
/// Tasks are uniquely identified by UUIDs.
|
||||||
|
/// Most task modifications are performed via the [`crate::Task`] and [`crate::TaskMut`] types.
|
||||||
|
///
|
||||||
|
/// ## Working Set
|
||||||
|
///
|
||||||
|
/// A replica maintains a "working set" of tasks that are of current concern to the user,
|
||||||
|
/// specifically pending tasks. These are indexed with small, easy-to-type integers. Newly
|
||||||
|
/// pending tasks are automatically added to the working set, and the working set is "renumbered"
|
||||||
|
/// during the garbage-collection process.
|
||||||
pub struct Replica {
|
pub struct Replica {
|
||||||
taskdb: TaskDB,
|
taskdb: TaskDB,
|
||||||
}
|
}
|
||||||
|
@ -23,6 +35,8 @@ impl Replica {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Construct a new replica from a configuration object. This is the common way
|
||||||
|
/// to create a new object.
|
||||||
pub fn from_config(config: ReplicaConfig) -> Fallible<Replica> {
|
pub fn from_config(config: ReplicaConfig) -> Fallible<Replica> {
|
||||||
let storage = Box::new(KVStorage::new(config.taskdb_dir)?);
|
let storage = Box::new(KVStorage::new(config.taskdb_dir)?);
|
||||||
Ok(Replica::new(storage))
|
Ok(Replica::new(storage))
|
||||||
|
|
|
@ -12,6 +12,7 @@ pub use local::LocalServer;
|
||||||
pub use remote::RemoteServer;
|
pub use remote::RemoteServer;
|
||||||
pub use types::*;
|
pub use types::*;
|
||||||
|
|
||||||
|
/// Create a new server based on the given configuration.
|
||||||
pub fn from_config(config: ServerConfig) -> Fallible<Box<dyn Server>> {
|
pub fn from_config(config: ServerConfig) -> Fallible<Box<dyn Server>> {
|
||||||
Ok(match config {
|
Ok(match config {
|
||||||
ServerConfig::Local { server_dir } => Box::new(LocalServer::new(server_dir)?),
|
ServerConfig::Local { server_dir } => Box::new(LocalServer::new(server_dir)?),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue