1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! # io-vdir
//!
//! I/O-free Vdir coroutines: every filesystem operation on a [vdir]
//! tree is a resumable state machine that emits requests (create a
//! directory, read a file, rename a path, draw random bytes) instead
//! of performing the I/O itself. The caller services each request and
//! resumes the coroutine, so the same logic drives blocking, async or
//! in-memory harnesses without change.
//!
//! ## Layers
//!
//! The core [`coroutine`] layer is `no_std` and pulls no runtime: it
//! defines the [`coroutine::VdirCoroutine`] trait, the shared
//! [`coroutine::VdirYield`] request and [`coroutine::VdirReply`]
//! response enums, and the `vdir_try!` macro that chains one
//! coroutine into another. The optional `client` feature adds
//! [`client::VdirClient`], a blocking client that runs any coroutine
//! against the local filesystem through `std::fs`.
//!
//! ## Layout
//!
//! The source tree mirrors the two Vdir concepts. [`collection`] owns
//! the [`collection::VdirCollection`] handle and one coroutine per
//! directory operation (create, delete, list, rename, update).
//! [`item`] owns the [`item::VdirItem`] handle, its
//! [`item::VdirItemKind`] and one coroutine per item operation
//! (store, get, list, locate, copy, move, delete). [`path`] holds the
//! forward-slash [`path::VdirPath`] newtype shared across both.
//!
//! ## Encoding
//!
//! Items are opaque bytes at every level: io-vdir never parses them,
//! leaving the choice of vCard or iCalendar parser to the caller. The
//! `serde` feature derives (de)serialization on the public handles.
//!
//! [vdir]: https://vdirsyncer.pimutils.org/en/stable/vdir.html
extern crate alloc;
extern crate std;