pub struct AuthorisedEntry<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> { /* private fields */ }Expand description
An entry, together with an authorisation token that authorises the entry.
There are three typical scenarios for creating these: authorising an Entry yourself (via Entry::into_authorised_entry or crate::entry::EntrylikeExt::wdm_authorise), or receiving and verifying an untrusted authorisation token (PossiblyAuthorisedEntry::into_authorised_entry).
use willow_data_model::prelude::*;
use willow_data_model::test_parameters::*;
let entry = Entry::builder()
.namespace_id(Family)
.subspace_id(Alfie)
.path(Path::<4, 4, 4>::new())
.timestamp(12345)
.payload_digest(Spades)
.payload_length(2)
.build().unwrap();
let authed = entry.into_authorised_entry::<TestSubspaceSignature>(&AlfieSecret).unwrap();
assert_eq!(authed.as_authorisation_token(), &AlfieSignature);Implementations§
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Sourcepub fn into_parts(self) -> (Entry<MCL, MCC, MPL, N, S, PD>, AT)
pub fn into_parts(self) -> (Entry<MCL, MCC, MPL, N, S, PD>, AT)
Consumes self, returning the entry and the authorisation token.
Sourcepub fn as_mut_entry(&mut self) -> &mut Entry<MCL, MCC, MPL, N, S, PD>
pub fn as_mut_entry(&mut self) -> &mut Entry<MCL, MCC, MPL, N, S, PD>
Returns a mutable reference to the entry.
Returns a reference to the authorisation token.
Returns a mutable reference to the authorisation token.
Trait Implementations§
Source§impl<'arbitrary, const MCL: usize, const MCC: usize, const MPL: usize, N: Arbitrary<'arbitrary>, S: Arbitrary<'arbitrary>, PD: Arbitrary<'arbitrary>, AT: Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<'arbitrary, const MCL: usize, const MCC: usize, const MPL: usize, N: Arbitrary<'arbitrary>, S: Arbitrary<'arbitrary>, PD: Arbitrary<'arbitrary>, AT: Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Clone, S: Clone, PD: Clone, AT: Clone> Clone for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Clone, S: Clone, PD: Clone, AT: Clone> Clone for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§fn clone(&self) -> AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
fn clone(&self) -> AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Coordinatelike<MCL, MCC, MPL, S> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Coordinatelike<MCL, MCC, MPL, S> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§fn wdm_timestamp(&self) -> Timestamp
fn wdm_timestamp(&self) -> Timestamp
Returns the timestamp of
self.Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Debug, S: Debug, PD: Debug, AT: Debug> Debug for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Debug, S: Debug, PD: Debug, AT: Debug> Debug for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Entrylike<MCL, MCC, MPL, N, S, PD> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Entrylike<MCL, MCC, MPL, N, S, PD> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§fn wdm_payload_length(&self) -> u64
fn wdm_payload_length(&self) -> u64
Returns the payload_length of
self.Source§fn wdm_payload_digest(&self) -> &PD
fn wdm_payload_digest(&self) -> &PD
Returns the payload_digest of
self.Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Hash, S: Hash, PD: Hash, AT: Hash> Hash for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Hash, S: Hash, PD: Hash, AT: Hash> Hash for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Keylike<MCL, MCC, MPL, S> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Keylike<MCL, MCC, MPL, S> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§fn wdm_subspace_id(&self) -> &S
fn wdm_subspace_id(&self) -> &S
Returns the subspace_id of
self.Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Namespaced<N> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Namespaced<N> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§fn wdm_namespace_id(&self) -> &N
fn wdm_namespace_id(&self) -> &N
Returns the namespace id of
self.Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Ord, S: Ord, PD: Ord, AT: Ord> Ord for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Ord, S: Ord, PD: Ord, AT: Ord> Ord for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§fn cmp(&self, other: &AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>) -> Ordering
fn cmp(&self, other: &AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: PartialEq, S: PartialEq, PD: PartialEq, AT: PartialEq> PartialEq for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: PartialEq, S: PartialEq, PD: PartialEq, AT: PartialEq> PartialEq for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§fn eq(&self, other: &AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>) -> bool
fn eq(&self, other: &AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: PartialOrd, S: PartialOrd, PD: PartialOrd, AT: PartialOrd> PartialOrd for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: PartialOrd, S: PartialOrd, PD: PartialOrd, AT: PartialOrd> PartialOrd for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Eq, S: Eq, PD: Eq, AT: Eq> Eq for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> StructuralPartialEq for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Auto Trait Implementations§
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> !Freeze for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> RefUnwindSafe for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Send for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Sync for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Unpin for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> UnwindSafe for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, S, T> CoordinatelikeExt<MCL, MCC, MPL, S> for Twhere
T: Coordinatelike<MCL, MCC, MPL, S>,
impl<const MCL: usize, const MCC: usize, const MPL: usize, S, T> CoordinatelikeExt<MCL, MCC, MPL, S> for Twhere
T: Coordinatelike<MCL, MCC, MPL, S>,
Source§fn wdm_coordinate_eq<OtherCoordinate>(&self, other: &OtherCoordinate) -> boolwhere
OtherCoordinate: Coordinatelike<MCL, MCC, MPL, S>,
S: PartialEq,
fn wdm_coordinate_eq<OtherCoordinate>(&self, other: &OtherCoordinate) -> boolwhere
OtherCoordinate: Coordinatelike<MCL, MCC, MPL, S>,
S: PartialEq,
Returns whether
self and other describe equal coordinates, i.e., whether their subspace ids, paths, and timestamps are all equal. Read moreSource§fn wdm_coordinate_ne<OtherCoordinate>(&self, other: &OtherCoordinate) -> boolwhere
OtherCoordinate: Coordinatelike<MCL, MCC, MPL, S>,
S: PartialEq,
fn wdm_coordinate_ne<OtherCoordinate>(&self, other: &OtherCoordinate) -> boolwhere
OtherCoordinate: Coordinatelike<MCL, MCC, MPL, S>,
S: PartialEq,
Returns whether
self and other describe non-equal coordinates, i.e., whether their subspace ids, paths, and timestamps are not all equal. Read moreSource§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, E> EntrylikeExt<MCL, MCC, MPL, N, S, PD> for Ewhere
E: Entrylike<MCL, MCC, MPL, N, S, PD>,
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, E> EntrylikeExt<MCL, MCC, MPL, N, S, PD> for Ewhere
E: Entrylike<MCL, MCC, MPL, N, S, PD>,
Source§fn wdm_entry_eq<OtherEntry>(&self, other: &OtherEntry) -> bool
fn wdm_entry_eq<OtherEntry>(&self, other: &OtherEntry) -> bool
Source§fn wdm_entry_ne<OtherEntry>(&self, other: &OtherEntry) -> bool
fn wdm_entry_ne<OtherEntry>(&self, other: &OtherEntry) -> bool
Source§fn wdm_cmp_recency<OtherEntry>(&self, other: &OtherEntry) -> Ordering
fn wdm_cmp_recency<OtherEntry>(&self, other: &OtherEntry) -> Ordering
Compares
self to another entry by timestamp, payload_digest (in case of a tie), and payload_length third (in case of yet another tie). See also EntrylikeExt::wdm_is_newer_than and EntrylikeExt::wdm_is_older_than. Read moreSource§fn wdm_is_newer_than<OtherEntry>(&self, other: &OtherEntry) -> bool
fn wdm_is_newer_than<OtherEntry>(&self, other: &OtherEntry) -> bool
Returns whether this entry is strictly newer than another entry. See also
EntrylikeExt::wdm_cmp_recency and EntrylikeExt::wdm_is_older_than. Read moreSource§fn wdm_is_older_than<OtherEntry>(&self, other: &OtherEntry) -> bool
fn wdm_is_older_than<OtherEntry>(&self, other: &OtherEntry) -> bool
Returns whether this entry is strictly older than another entry. See also
EntrylikeExt::wdm_cmp_recency and EntrylikeExt::wdm_is_newer_than. Read moreSource§fn wdm_prunes<OtherEntry>(&self, other: &OtherEntry) -> bool
fn wdm_prunes<OtherEntry>(&self, other: &OtherEntry) -> bool
Returns whether this entry would prefix prune another entry. Read more
Source§fn wdm_is_pruned_by<OtherEntry>(&self, other: &OtherEntry) -> bool
fn wdm_is_pruned_by<OtherEntry>(&self, other: &OtherEntry) -> bool
Returns whether this entry would be prefix pruned by another entry. Read more
Source§async fn wdm_encode_entry<C>(&self, consumer: &mut C) -> Result<(), C::Error>
async fn wdm_encode_entry<C>(&self, consumer: &mut C) -> Result<(), C::Error>
Encodes
self according to the encode_entry encoding function.Source§fn wdm_length_of_entry_encoding(&self) -> usize
fn wdm_length_of_entry_encoding(&self) -> usize
Computes the length of the encoding of
self according to the encode_entry encoding function.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<const MCL: usize, const MCC: usize, const MPL: usize, S, T> KeylikeExt<MCL, MCC, MPL, S> for Twhere
T: Keylike<MCL, MCC, MPL, S>,
impl<const MCL: usize, const MCC: usize, const MPL: usize, S, T> KeylikeExt<MCL, MCC, MPL, S> for Twhere
T: Keylike<MCL, MCC, MPL, S>,
Source§fn wdm_key_eq<OtherKey>(&self, other: &OtherKey) -> bool
fn wdm_key_eq<OtherKey>(&self, other: &OtherKey) -> bool
Returns whether
self and other describe equal keys, i.e., whether their subspace ids and paths are both equal. Read moreSource§fn wdm_key_ne<OtherKey>(&self, other: &OtherKey) -> bool
fn wdm_key_ne<OtherKey>(&self, other: &OtherKey) -> bool
Returns whether
self and other describe non-equal keys, i.e., whether their subspace ids and paths are not both equal. Read more