pub enum TestDigest {
Clubs,
Diamonds,
Hearts,
Spades,
}Expand description
A payload digest for testing.
To hash a bytestring, add all its bytes modulo 256, and take the result modulo 4, mapping to the different values as follows:
- 0 -> Clubs
- 1 -> Diamonds
- 2 -> Hearts
- 3 -> Spades
In case you did not notice, this is not cryptographically secure.
Variants§
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for TestDigest
impl<'arbitrary> Arbitrary<'arbitrary> for TestDigest
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 AuthorisationToken<4, 4, 4, TestNamespace, TestSubspace, TestDigest> for TestSubspaceSignature
impl AuthorisationToken<4, 4, 4, TestNamespace, TestSubspace, TestDigest> for TestSubspaceSignature
Source§type CreationError = ()
type CreationError = ()
Emitted when the secret does not correspond to the subspace of the entry to authorise.
Determines whether self authorises the given entry.
Source§type Ingredients = TestSubspaceSecret
type Ingredients = TestSubspaceSecret
The type of the information you need in order to authorise an entry. For example, in Meadowcap, this would be a pair of a capability and a secret key.
Source§fn new_for_entry<E>(
entry: &E,
ingredients: &Self::Ingredients,
) -> Result<Self, Self::CreationError>
fn new_for_entry<E>( entry: &E, ingredients: &Self::Ingredients, ) -> Result<Self, Self::CreationError>
Creates an authorisation token for the given entry, if possible.
Source§impl AuthorisationToken<4, 4, 4, TestSubspace, TestSubspace, TestDigest> for TestSubspaceSignature
impl AuthorisationToken<4, 4, 4, TestSubspace, TestSubspace, TestDigest> for TestSubspaceSignature
Source§type Ingredients = ()
type Ingredients = ()
The type of the information you need in order to authorise an entry. For example, in Meadowcap, this would be a pair of a capability and a secret key.
Source§type CreationError = Infallible
type CreationError = Infallible
Everything that can go wrong when trying to create a new authorisation token from some
Ingredients for some entry.Source§fn new_for_entry<E>(
entry: &E,
_ingredients: &Self::Ingredients,
) -> Result<Self, Self::CreationError>
fn new_for_entry<E>( entry: &E, _ingredients: &Self::Ingredients, ) -> Result<Self, Self::CreationError>
Creates an authorisation token for the given entry, if possible.
Determines whether
self authorises the given entry.Source§impl Clone for TestDigest
impl Clone for TestDigest
Source§fn clone(&self) -> TestDigest
fn clone(&self) -> TestDigest
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 Debug for TestDigest
impl Debug for TestDigest
Source§impl Decodable for TestDigest
impl Decodable for TestDigest
Source§type ErrorReason = Blame
type ErrorReason = Blame
Reason why decoding can fail (beyond an unexpected end of input or a producer error).
Source§async fn decode<P>(
producer: &mut P,
) -> Result<Self, DecodeError<P::Final, P::Error, Self::ErrorReason>>
async fn decode<P>( producer: &mut P, ) -> Result<Self, DecodeError<P::Final, P::Error, Self::ErrorReason>>
Decodes the symbols produced by the given bulk producer into a
Self, or yields an error if the producer does not produce a valid encoding. Read moreSource§impl DecodableCanonic for TestDigest
impl DecodableCanonic for TestDigest
Source§type ErrorCanonic = Blame
type ErrorCanonic = Blame
The type for reporting that the sequence of symbols to decode was not a valid canonic encoding of any value of type
Self. Read moreSource§async fn decode_canonic<P>(
producer: &mut P,
) -> Result<Self, DecodeError<P::Final, P::Error, Self::ErrorCanonic>>
async fn decode_canonic<P>( producer: &mut P, ) -> Result<Self, DecodeError<P::Final, P::Error, Self::ErrorCanonic>>
Decodes the symbols produced by the given bulk producer into a
Self, and errors if the input encoding is not the canonical one.Source§impl Encodable for TestDigest
impl Encodable for TestDigest
Source§impl EncodableKnownLength for TestDigest
impl EncodableKnownLength for TestDigest
Source§fn len_of_encoding(&self) -> usize
fn len_of_encoding(&self) -> usize
Computes the number of symbols of the encoding of
self. A successful call to encode must feed exactly that many symbols into the bulk consumer.Source§impl Hash for TestDigest
impl Hash for TestDigest
Source§impl Hasher<TestDigest> for TestDigestHasher
impl Hasher<TestDigest> for TestDigestHasher
Source§fn finish(&self) -> TestDigest
fn finish(&self) -> TestDigest
Returns the hash value for the values written so far.
Source§impl Ord for TestDigest
impl Ord for TestDigest
Source§fn cmp(&self, other: &TestDigest) -> Ordering
fn cmp(&self, other: &TestDigest) -> 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 PartialEq for TestDigest
impl PartialEq for TestDigest
Source§impl PartialOrd for TestDigest
impl PartialOrd for TestDigest
impl Copy for TestDigest
impl Eq for TestDigest
impl StructuralPartialEq for TestDigest
Auto Trait Implementations§
impl Freeze for TestDigest
impl RefUnwindSafe for TestDigest
impl Send for TestDigest
impl Sync for TestDigest
impl Unpin for TestDigest
impl UnwindSafe for TestDigest
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, S> EncodableExt<S> for Twhere
T: Encodable<S>,
impl<T, S> EncodableExt<S> for Twhere
T: Encodable<S>,
Source§impl<T, S> EncodableKnownLengthExt<S> for Twhere
T: EncodableKnownLength<S>,
impl<T, S> EncodableKnownLengthExt<S> for Twhere
T: EncodableKnownLength<S>,
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