pub struct AuthorisedEntry<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT>(/* private fields */);Expand description
An AuthorisedEntry is a pair of an Entry and AuthorisationToken for which AuthorisationToken::is_authorised_write returns true.
Implementations§
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>where
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD>,
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>where
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD>,
Sourcepub fn new(
entry: Entry<MCL, MCC, MPL, N, S, PD>,
token: AT,
) -> Result<Self, UnauthorisedWriteError>where
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD>,
pub fn new(
entry: Entry<MCL, MCC, MPL, N, S, PD>,
token: AT,
) -> Result<Self, UnauthorisedWriteError>where
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD>,
Returns an AuthorisedEntry if the token permits the writing of this entry, otherwise returns an UnauthorisedWriteError.
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 unsafe fn new_unchecked(
entry: Entry<MCL, MCC, MPL, N, S, PD>,
token: AT,
) -> Self
pub unsafe fn new_unchecked( entry: Entry<MCL, MCC, MPL, N, S, PD>, token: AT, ) -> Self
Returns an AuthorisedEntry without checking if the token permits the writing of this entry.
§Safety
Calling this method when token.is_authorised_write(&entry) would return false is immediate undefined behaviour!
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)
Splits this into Entry and AuthorisationToken halves.
Sourcepub fn token(&self) -> &AT
pub fn token(&self) -> &AT
Gets a reference to the AuthorisationToken.
Trait Implementations§
Source§impl<'a, const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Arbitrary<'a> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>where
N: Arbitrary<'a>,
S: Arbitrary<'a>,
PD: Arbitrary<'a>,
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD> + Arbitrary<'a>,
impl<'a, const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Arbitrary<'a> for AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>where
N: Arbitrary<'a>,
S: Arbitrary<'a>,
PD: Arbitrary<'a>,
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD> + Arbitrary<'a>,
Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
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, S, PD, AT> AsRef<AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>> for LengthyAuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> AsRef<AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>> for LengthyAuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Source§fn as_ref(&self) -> &AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
fn as_ref(&self) -> &AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>
Converts this type into a shared reference of the (usually inferred) input type.
Source§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: 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: 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: 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<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 more