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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//! [Groupings](https://willowprotocol.org/specs/grouping-entries/) of entries in 3d space.
//!
//! This module implements the [groupings](https://willowprotocol.org/specs/grouping-entries/) used by the Willow specifications:
//!
//! - [ranges](https://willowprotocol.org/specs/grouping-entries/#ranges) ([`WillowRange`]),
//! - [3d ranges](https://willowprotocol.org/specs/grouping-entries/#D3Range) ([`Range3d`]),
//! - [areas](https://willowprotocol.org/specs/grouping-entries/#areas) ([`Area`]), and
//! - [areas of interest](https://willowprotocol.org/specs/grouping-entries/#aois) ([`AreaOfInterest`]).
//!
//! Our implementations center around two traits: [`Coordinatelike`] describes values which fall into some position in three-dimensional Willow space, and [`Grouping`] describes groupings of values based on their position in three-dimensional Willow space. The [`CoordinatelikeExt`] trait then provides convenient methods for checking which values are included in which groupings.
//!
//! ```
//! use willow_data_model::prelude::*;
//!
//! let entry = Entry::builder()
//! .namespace_id("family")
//! .subspace_id([5; 32])
//! .path(Path::<4, 4, 4>::new())
//! .timestamp(12345)
//! .payload_digest("some_hash")
//! .payload_length(17)
//! .build().unwrap();
//!
//! assert!(entry.wdm_is_in(&Range3d::full()));
//! assert!(!entry.wdm_is_in(&Area::wdm_empty()));
//! ```
use crate*;
use BoundedLowerSemilattice;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
/// A [`WillowRange`] of [SubspaceIds](https://willowprotocol.org/specs/data-model/index.html#SubspaceId).
///
/// [TODO example]
///
/// [Specification](https://willowprotocol.org/specs/grouping-entries/index.html#SubspaceRange)
pub type SubspaceRange<S> = ;
/// A [`WillowRange`] of [Paths](https://willowprotocol.org/specs/data-model/index.html#Path).
///
/// [TODO example]
///
/// [Specification](https://willowprotocol.org/specs/grouping-entries/index.html#PathRange)
pub type PathRange<const MCL: usize, const MCC: usize, const MPL: usize> =
;
/// A [`WillowRange`] of [Timestamps](https://willowprotocol.org/specs/data-model/index.html#Timestamp).
///
/// [TODO example]
///
/// [Specification](https://willowprotocol.org/specs/grouping-entries/index.html#TimeRange)
pub type TimeRange = ;
/// A grouping of entries.
///
/// A grouping describes a set of [`Coordinatelike`] values, with [`Grouping::wdm_includes`] providing the membership test. Groupings must form a [`BoundedLowerSemilattice`], with the least element including no values at all, and the partial order corresponding to the subset relation of included values.