Module entry

Module entry 

Source
Expand description

Functionality around Willow Entries.

Entries are the metadata by which payload strings are identified in Willow — see the Entry struct for more information.

Applications can construct concrete entries via EntryBuilders. 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.

use willow_data_model::prelude::*;

let entry = Entry::builder()
    .namespace_id("family")
    .subspace_id("alfie")
    .path(Path::<4, 4, 4>::new())
    .timestamp(12345)
    .payload_digest("some_hash")
    .payload_length(17)
    .build().unwrap();

assert_eq!(*entry.wdm_subspace_id(), "alfie");

let newer = Entry::prefilled_builder(&entry).timestamp(99999).build().unwrap();
assert!(newer.wdm_prunes(&entry));

Structs§

Entry
The metadata associated with each Willow Payload string.
EntryBuilder
A builder for Entry.

Enums§

EntryBuilderError
Everything that can go wrong when trying to build an Entry.

Traits§

Entrylike
A trait describing the metadata associated with each Willow Payload string.
EntrylikeExt
Methods for working with Entrylikes.