Crate willow_data_model

Source
Expand description

§Willow Data Model

This crate provides implementation of the Willow Data Model, including:

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:

Modules§

grouping
Utilities for Willow’s entry groupings.

Structs§

AreaNotAlmostIncludedError
AuthorisedEntry
An AuthorisedEntry is a pair of an Entry and AuthorisationToken for which AuthorisationToken::is_authorised_write returns true.
Component
A component of a Willow Path.
ComponentsNotRelatedError
Entry
The metadata associated with each Payload.
EventSystem
InternalSubscriber
The internal part of a subscriber.
LengthyAuthorisedEntry
An AuthorisedEntry together with information about how much of its payload a given crate::Store holds.
LengthyEntry
An Entry together with information about how much of its payload a given crate::Store holds.
OwnedComponent
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).
PathBuilder
A helper struct for creating a Path with exactly one memory allocation. Requires total length and component count to be known in advance.
PrivateAreaContext
The context necessary to privately encode Areas.
PrivateInterest
Confidential data that relates to determining the AreasOfInterest that peers might be interested in synchronising.
PrivatePathContext
The context necessary to privately encode Paths.
QueryIgnoreParams
Describes which entries to ignore during a query.
Subscriber
The public-facing part of a subscriber (to be returned by Store::subscribe_area).
UnauthorisedWriteError
An error indicating an AuthorisationToken does not authorise the writing of this entry.

Enums§

EntryIngestionError
Returned when an entry cannot be ingested into a Store.
EntryIngestionSuccess
Returned when an entry could be ingested into a Store.
EntryOrigin
The origin of an entry ingestion event.
ForgetEntryError
Returned when forgetting an entry fails.
ForgetPayloadError
Returned when forgetting a payload fails.
InvalidPathError
An error arising from trying to construct a invalid Path from valid components.
PayloadAppendError
Returned when a payload fails to be appended into the Store.
PayloadAppendSuccess
Returned when a payload is successfully appended to the Store.
PayloadError
Returned when retrieving a payload fails.
StoreEvent
A notification about changes in a Store. You can obtain a producer of these via the Store::subscribe_area method.

Traits§

AuthorisationToken
Determines whether this type (nominally an AuthorisationToken) is able to prove write permission for a given Entry.
NamespaceId
A type for identifying namespaces.
PayloadDigest
A totally ordered type for content-addressing the data that Willow stores.
Store
A Store is a set of AuthorisedEntry belonging to a single namespace, and a (possibly partial) corresponding set of payloads.
SubspaceId
A type for identifying subspaces.
TrustedDecodable
Methods for decoding trusted encodings,that is, data which was already deemed trustworthy prior to encoding.
TrustedRelativeDecodable
Methods for decoding trusted encodings (that is, data which was deemed trustworthy prior to encoding), relative to type R.

Functions§

decode_path_extends_path
encode_path_extends_path

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.