kitchen_fridge/lib.rs
1//! This crate provides a CalDAV client library. \
2//! CalDAV is described as "Calendaring Extensions to WebDAV" in [RFC 4791](https://datatracker.ietf.org/doc/html/rfc4791) and [RFC 7986](https://datatracker.ietf.org/doc/html/rfc7986) and the underlying iCal format is described at least in [RFC 5545](https://datatracker.ietf.org/doc/html/rfc5545). \
3//! This library has been intensivley tested with Nextcloud servers. It should support Owncloud and iCloud as well, since they use the very same CalDAV protocol.
4//!
5//! This initial implementation only supports TODO events. Thus it can fetch and update a CalDAV-hosted todo-list...just like [sticky notes on a kitchen fridge](https://www.google.com/search?q=kitchen+fridge+todo+list&tbm=isch) would. \
6//! Supporting other items (and especially regular CalDAV calendar events) should be fairly trivial, as it should boil down to adding little logic in iCal files parsing, but any help is appreciated :-)
7//!
8//! ## Possible uses
9//!
10//! It provides a CalDAV client in the [`client`] module, that can be used as a stand-alone module.
11//!
12//! Because the connection to the server may be slow, this crate also provides a local cache for CalDAV data in the [`cache`] module.
13//! This way, user-frendly apps are able to quicky display cached data on startup.
14//!
15//! These two "data sources" (actual client and local cache) can be used together in a [`CalDavProvider`](CalDavProvider). \
16//! A `CalDavProvider` abstracts these two sources by merging them together into one virtual source. \
17//! It also handles synchronisation between the local cache and the server, and robustly recovers from any network error (so that it never corrupts the local or remote source).
18//!
19//! Note that many methods are defined in common traits (see [`crate::traits`]).
20//!
21//! ## Examples
22//!
23//! See example usage in the `examples/` folder, that you can run using `cargo run --example <example-name>`. \
24//! You can also have a look at [`VoilĂ `](https://github.com/daladim/voila-tasks), a GUI app that uses `kitchen-fridge` under the hood.
25//!
26//! ## Configuration options
27//!
28//! Have a look at the [`config`] module to see what default options can be overridden.
29
30#![doc(html_logo_url = "https://raw.githubusercontent.com/daladim/kitchen-fridge/master/resources/kitchen-fridge.svg")]
31
32pub mod traits;
33
34pub mod calendar;
35pub mod item;
36pub use item::Item;
37pub mod task;
38pub use task::Task;
39pub mod event;
40pub use event::Event;
41pub mod provider;
42pub mod mock_behaviour;
43
44pub mod client;
45pub use client::Client;
46pub mod cache;
47pub use cache::Cache;
48pub mod ical;
49
50pub mod config;
51pub mod utils;
52pub mod resource;
53
54/// Unless you want another kind of Provider to write integration tests, you'll probably want this kind of Provider. \
55/// See alse the [`Provider` documentation](crate::provider::Provider)
56pub type CalDavProvider = provider::Provider<cache::Cache, calendar::cached_calendar::CachedCalendar, Client, calendar::remote_calendar::RemoteCalendar>;