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
58
59
60
use crateEntry;
use Debug;
/// A type for identifying [namespaces](https://willowprotocol.org/specs/data-model/index.html#namespace).
///
/// When an implementing type implements [`PartialOrd`], then `Self::default()` must return a least element with respect to the ordering.
///
/// [Definition](https://willowprotocol.org/specs/data-model/index.html#NamespaceId).
/// A type for identifying [subspaces](https://willowprotocol.org/specs/data-model/index.html#subspace).
///
/// [Definition](https://willowprotocol.org/specs/data-model/index.html#SubspaceId).
///
/// ## Implementation notes
///
/// The [`Default`] implementation **must** return the least element in the total order of [`SubspaceId`].
/// A totally ordered type for [content-addressing](https://en.wikipedia.org/wiki/Content_addressing) the data that Willow stores.
///
/// This trait mirrors the [`std::hash::Hasher`] trait (with the hasher state as an associated type), but hashing not to `u64`s but to `Self`s.
///
/// [Definition](https://willowprotocol.org/specs/data-model/index.html#PayloadDigest).
///
/// ## Implementation notes
///
/// The [`Default`] implementation **must** return the least element in the total order of [`PayloadDigest`].
/// Determines whether this type (nominally an [`AuthorisationToken`](https://willowprotocol.org/specs/data-model/index.html#AuthorisationToken)) is able to prove write permission for a given [`Entry`].
///
/// ## Type parameters
///
/// - `N` - The type used for the [`Entry`]'s [`NamespaceId`].
/// - `S` - The type used for the [`Entry`]'s [`SubspaceId`].
/// - `PD` - The type used for the [`Entry`]'s [`PayloadDigest`].