Skip to main content

Crate todoist_cache_rs

Crate todoist_cache_rs 

Source
Expand description

Local cache for Todoist data.

This crate provides a local cache that mirrors the Sync API response structure, enabling efficient incremental updates and offline read access.

§Storage

The cache is stored on disk using XDG-compliant paths via CacheStore:

  • Unix: ~/.cache/td/cache.json
  • macOS: ~/Library/Caches/td/cache.json
  • Windows: C:\Users\<User>\AppData\Local\td\cache\cache.json

§Example

use todoist_cache_rs::{Cache, CacheStore};

// Create a store with the default XDG path
let store = CacheStore::new()?;

// Load existing cache or create a new one
let mut cache = store.load_or_default()?;

// Modify the cache...
cache.sync_token = "new_token".to_string();

// Save changes to disk
store.save(&cache)?;

Modules§

filter
Filter expression parser and evaluator for Todoist filter syntax.

Structs§

Cache
Local cache for Todoist data.
CacheIndexes
Indexes for O(1) cache lookups.
CacheStore
Persistent storage for the Todoist cache.
SyncManager
Orchestrates synchronization between the Todoist API and local cache.

Enums§

CacheStoreError
Errors that can occur during cache storage operations.
SyncError
Errors that can occur during sync operations.

Type Aliases§

CacheStoreResult
Result type for cache store operations.
SyncResult
Result type for sync operations.