willow_data_model/entry/
mod.rs

1//! Functionality around Willow [Entries](https://willowprotocol.org/specs/data-model/index.html#Entry).
2//!
3//! Entries are the metadata by which payload strings are identified in Willow — see the [`Entry`] struct for more information.
4//!
5//! Applications can construct concrete entries via [`EntryBuilders`](EntryBuilder). Code which merely needs to inspect entries should make use of the [`Entrylike`] trait, however. This trait describes exactly which information an entry provides, and lets code abstract over any *specific* representation (such as the [`Entry`] struct) of entries.
6//!
7//! ```
8//! use willow_data_model::prelude::*;
9//!
10//! let entry = Entry::builder()
11//!     .namespace_id("family")
12//!     .subspace_id("alfie")
13//!     .path(Path::<4, 4, 4>::new())
14//!     .timestamp(12345)
15//!     .payload_digest("some_hash")
16//!     .payload_length(17)
17//!     .build().unwrap();
18//!
19//! assert_eq!(*entry.wdm_subspace_id(), "alfie");
20//!
21//! let newer = Entry::prefilled_builder(&entry).timestamp(99999).build().unwrap();
22//! assert!(newer.wdm_prunes(&entry));
23//! ```
24
25#[allow(clippy::module_inception)]
26mod entry;
27pub use entry::*;
28
29mod entrylike;
30pub use entrylike::*;
31
32mod builder;
33pub use builder::*;