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
52
53
54
55
56
57
//! The caller context the in-repo reference `MemoryBackend`s accept.
use Id;
/// A caller context the in-repo reference `MemoryBackend`s accept as their
/// [`JmapAccounts::CallerCtx`](crate::JmapAccounts::CallerCtx): anything
/// that names the caller's Principal, or names none.
///
/// Every reference backend in this workspace is generic over one
/// `C: MemoryCaller`, with [`Id`] as the default, and its
/// [`JmapAccounts::principal_id`](crate::JmapAccounts::principal_id)
/// returns [`MemoryCaller::principal`]. A deployment therefore picks one
/// caller type and every family's memory backend takes it, so one
/// [`Dispatcher`](crate::Dispatcher) of that type hosts all their
/// handlers.
///
/// - [`Id`]: the caller is the Principal with that id. A backend that
/// models per-user rights (sharing, owners, moderators) checks them
/// against it; a single-user backend treats every caller as the account
/// owner.
/// - `()`: a deployment without identity. Every caller acts as the account
/// owner, with all rights.
///
/// A production deployment implements its own backends against its own
/// caller type and does not need this trait; it exists so the reference
/// backends agree on one.
/// The caller is the Principal with this id.
/// A deployment without identity: every caller acts as the account owner.