| Crates.io | taskchampion |
| lib.rs | taskchampion |
| version | 3.0.1 |
| created_at | 2020-11-30 02:11:55.917356+00 |
| updated_at | 2026-01-06 02:02:11.040355+00 |
| description | Personal task-tracking |
| homepage | https://gothenburgbitfactory.github.io/taskchampion/ |
| repository | https://github.com/GothenburgBitFactory/taskchampion |
| max_upload_size | |
| id | 318061 |
| size | 3,433,545 |
This crate implements the core of TaskChampion, the replica.
Users of this crate can manipulate a task database using this API, including synchronizing that task database with others via a synchronization server.
Example uses of this crate:
A TaskChampion replica is a local copy of a user's task data. As the name suggests, several replicas of the same data can exist (such as on a user's laptop and on their phone) and can synchronize with one another.
Replicas are accessed using the [Replica] type.
Replicas access the task database via a storage object.
The [storage] module supports pluggable storage for a replica's data.
An implementation is provided, but users of this crate can provide their own implementation as well.
Replica synchronization takes place against a server.
Create a server with [ServerConfig].
The [server] module defines the interface a server must meet.
Several server implementations are included, and users can define their own implementations.
# #[cfg(all(feature = "storage-sqlite", feature = "server-local"))]
# {
# use taskchampion::{storage::AccessMode, ServerConfig, Replica, SqliteStorage};
# use tempfile::TempDir;
# async fn main() -> anyhow::Result<()> {
# let taskdb_dir = TempDir::new()?;
# let taskdb_dir = taskdb_dir.path().to_path_buf();
# let server_dir = TempDir::new()?;
# let server_dir = server_dir.path().to_path_buf();
// Create a new Replica, storing data on disk.
let storage = SqliteStorage::new(
taskdb_dir,
AccessMode::ReadWrite,
true,
).await?;
let mut replica = Replica::new(storage);
// Set up a local, on-disk server.
let server_config = ServerConfig::Local { server_dir };
let mut server = server_config.into_server().await?;
// Sync to that server.
replica.sync(&mut server, true).await?;
#
# Ok(())
# }
# }
Support for some optional functionality is controlled by feature flags.
server-aws - sync to Amazon Web Servicesserver-gcp - sync to Google Cloud Platformserver-sync - sync to the taskchampion-sync-serverserver-local - sync to a local filesync - enables all of the sync features abovestorage-indexeddb - store task data in the browser using IndexedDB (WASM only)storage-sqlite - store task data locally in SQLitestorage - enables all of the storage features above except storage-indexeddbbundled - activates bundling system libraries like sqlitetls-webpki-roots - use TLS roots bundled with the library, instead of reading them from
system configuration.tls-native-roots - use native (system) TLS roots, instead of those bundled with rustls.
If both tls-webpki-roots and tls-native-roots are given, tls-native-roots takes
precedence. At least one of the tls-*-roots features must be enabled to support any
of the HTTPS-based server-* features.By default, sync, storage, bundled, and tls-webpki-roots are enabled.
TaskChampion can be built for WASM with the usual WASM tools, such as
wasm-pack. Only the following features are supported:
server-sync - communicate with the sync server using the Fetch APIstorage-indexeddb - store task data in the browser using IndexedDB (WASM only)See the TaskChampion Book for more information about the design and usage of the tool.
This crate supports Rust version 1.88.0 and higher.