Expand description
§Willow Data Model
This crate provides implementation of the Willow Data Model, including:
- Traits to assist in your implementation of Willow parameters, such as
NamespaceId
andSubspaceId
. - A zero-copy implementation of Willow paths and their constituent components.
- An implementation of Willow’s entries.
- Utilities for Willow’s entry groupings, such as ranges and areas
- Implementations of various relative encodings.
This crate does not yet have anything for Willow’s concept of stores. Stay tuned!
§Type parameters
Willow is a parametrised family of protocols, and so this crate makes heavy use of generic parameters.
The following generic parameter names are used consistently across this crate:
MCL
- Ausize
representingmax_component_length
.MCC
- Ausize
representingmax_component_count
.MPL
- Ausize
representingmax_path_length
.N
- The type used forNamespaceId
(willowprotocol.org), must implement theNamespaceId
trait.S
- The type used forSubspaceId
(willowprotocol.org), must implement theSubspaceId
trait.PD
- The type used forPayloadDigest
(willowprotocol.org), must implement thePayloadDigest
trait.AT
- The type used forAuthorisationToken
(willowprotocol.org), must implement theAuthorisationToken
trait.
Modules§
Structs§
- Area
NotAlmost Included Error - Authorised
Entry - An AuthorisedEntry is a pair of an
Entry
andAuthorisationToken
for whichAuthorisationToken::is_authorised_write
returns true. - Component
- A component of a Willow Path.
- Components
NotRelated Error - Entry
- The metadata associated with each Payload.
- Event
System - Internal
Subscriber - The internal part of a subscriber.
- Lengthy
Authorised Entry - An
AuthorisedEntry
together with information about how much of its payload a givencrate::Store
holds. - Lengthy
Entry - An
Entry
together with information about how much of its payload a givencrate::Store
holds. - Owned
Component - An owned component of a Willow Path that uses reference counting for cheap cloning.
- Path
- An immutable Willow path. Thread-safe, cheap to clone, cheap to take prefixes of, expensive to append to (linear time complexity).
- Path
Builder - A helper struct for creating a
Path
with exactly one memory allocation. Requires total length and component count to be known in advance. - Private
Area Context - The context necessary to privately encode Areas.
- Private
Interest - Confidential data that relates to determining the AreasOfInterest that peers might be interested in synchronising.
- Private
Path Context - The context necessary to privately encode Paths.
- Query
Ignore Params - Describes which entries to ignore during a query.
- Subscriber
- The public-facing part of a subscriber (to be returned by Store::subscribe_area).
- Unauthorised
Write Error - An error indicating an
AuthorisationToken
does not authorise the writing of this entry.
Enums§
- Entry
Ingestion Error - Returned when an entry cannot be ingested into a
Store
. - Entry
Ingestion Success - Returned when an entry could be ingested into a
Store
. - Entry
Origin - The origin of an entry ingestion event.
- Forget
Entry Error - Returned when forgetting an entry fails.
- Forget
Payload Error - Returned when forgetting a payload fails.
- Invalid
Path Error - An error arising from trying to construct a invalid
Path
from valid components. - Payload
Append Error - Returned when a payload fails to be appended into the
Store
. - Payload
Append Success - Returned when a payload is successfully appended to the
Store
. - Payload
Error - Returned when retrieving a payload fails.
- Store
Event - A notification about changes in a
Store
. You can obtain a producer of these via theStore::subscribe_area
method.
Traits§
- Authorisation
Token - Determines whether this type (nominally an
AuthorisationToken
) is able to prove write permission for a givenEntry
. - Namespace
Id - A type for identifying namespaces.
- Payload
Digest - A totally ordered type for content-addressing the data that Willow stores.
- Store
- A
Store
is a set ofAuthorisedEntry
belonging to a single namespace, and a (possibly partial) corresponding set of payloads. - Subspace
Id - A type for identifying subspaces.
- Trusted
Decodable - Methods for decoding trusted encodings,that is, data which was already deemed trustworthy prior to encoding.
- Trusted
Relative Decodable - Methods for decoding trusted encodings (that is, data which was deemed trustworthy prior to encoding), relative to type
R
.
Functions§
Type Aliases§
- Timestamp
- A Timestamp is a 64-bit unsigned integer, that is, a natural number between zero (inclusive) and 2^64 (exclusive). Timestamps are to be interpreted as a time in microseconds since the Unix epoch.