pub struct ShardMembershipEntropy(/* private fields */);Expand description
Entropy used for shard membership assignment
Implementations§
Source§impl ShardMembershipEntropy
impl ShardMembershipEntropy
Sourcepub const fn slice_from_repr(value: &[[u8; 16]]) -> &[Self]
pub const fn slice_from_repr(value: &[[u8; 16]]) -> &[Self]
Convenient conversion from slice of underlying representation for efficiency purposes
Sourcepub const fn repr_from_slice(value: &[Self]) -> &[[u8; 16]]
pub const fn repr_from_slice(value: &[Self]) -> &[[u8; 16]]
Convenient conversion to slice of underlying representation for efficiency purposes
Trait Implementations§
Source§impl AsMut<[u8]> for ShardMembershipEntropy
impl AsMut<[u8]> for ShardMembershipEntropy
Source§impl AsRef<[u8]> for ShardMembershipEntropy
impl AsRef<[u8]> for ShardMembershipEntropy
Source§impl Clone for ShardMembershipEntropy
impl Clone for ShardMembershipEntropy
Source§fn clone(&self) -> ShardMembershipEntropy
fn clone(&self) -> ShardMembershipEntropy
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 ShardMembershipEntropy
impl Debug for ShardMembershipEntropy
Source§impl Decode for ShardMembershipEntropy
impl Decode for ShardMembershipEntropy
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Attempt to deserialise the value from input.
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
Source§impl Default for ShardMembershipEntropy
impl Default for ShardMembershipEntropy
Source§fn default() -> ShardMembershipEntropy
fn default() -> ShardMembershipEntropy
Returns the “default value” for a type. Read more
Source§impl Deref for ShardMembershipEntropy
impl Deref for ShardMembershipEntropy
Source§impl DerefMut for ShardMembershipEntropy
impl DerefMut for ShardMembershipEntropy
Source§impl<'de> Deserialize<'de> for ShardMembershipEntropy
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ShardMembershipEntropy
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ShardMembershipEntropy
impl Display for ShardMembershipEntropy
Source§impl Encode for ShardMembershipEntropy
impl Encode for ShardMembershipEntropy
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl From<ShardMembershipEntropy> for [u8; 16]
impl From<ShardMembershipEntropy> for [u8; 16]
Source§fn from(value: ShardMembershipEntropy) -> Self
fn from(value: ShardMembershipEntropy) -> Self
Converts to this type from the input type.
Source§impl Hash for ShardMembershipEntropy
impl Hash for ShardMembershipEntropy
Source§impl MaxEncodedLen for ShardMembershipEntropy
impl MaxEncodedLen for ShardMembershipEntropy
Source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
Source§impl Ord for ShardMembershipEntropy
impl Ord for ShardMembershipEntropy
Source§fn cmp(&self, other: &ShardMembershipEntropy) -> Ordering
fn cmp(&self, other: &ShardMembershipEntropy) -> 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 ShardMembershipEntropy
impl PartialEq for ShardMembershipEntropy
Source§impl PartialOrd for ShardMembershipEntropy
impl PartialOrd for ShardMembershipEntropy
Source§impl Serialize for ShardMembershipEntropy
Available on crate feature serde only.
impl Serialize for ShardMembershipEntropy
Available on crate feature
serde only.Source§impl TrivialType for ShardMembershipEntropy
impl TrivialType for ShardMembershipEntropy
Source§const METADATA: &[u8]
const METADATA: &[u8]
Data structure metadata in binary form, describing shape and types of the contents, see
[
IoTypeMetadataKind] for encoding details.const SIZE: u32 = _
§unsafe fn read_unaligned(bytes: &[u8]) -> Option<Self>
unsafe fn read_unaligned(bytes: &[u8]) -> Option<Self>
Read unaligned value from memory. Read more
§unsafe fn read_unaligned_unchecked(bytes: &[u8]) -> Self
unsafe fn read_unaligned_unchecked(bytes: &[u8]) -> Self
Similar to [
Self::read_unaligned()], but doesn’t do any checks at all. Read more§unsafe fn from_bytes(bytes: &[u8]) -> Option<&Self>
unsafe fn from_bytes(bytes: &[u8]) -> Option<&Self>
Create a reference to a type, which is represented by provided memory. Read more
§unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &Self
unsafe fn from_bytes_unchecked(bytes: &[u8]) -> &Self
Similar to [
Self::from_bytes()], but doesn’t do any checks at all. Read more§unsafe fn from_bytes_mut(bytes: &mut [u8]) -> Option<&mut Self>
unsafe fn from_bytes_mut(bytes: &mut [u8]) -> Option<&mut Self>
Create a mutable reference to a type, which is represented by provided memory. Read more
§unsafe fn from_bytes_mut_unchecked(bytes: &mut [u8]) -> &mut Self
unsafe fn from_bytes_mut_unchecked(bytes: &mut [u8]) -> &mut Self
Similar to [
Self::from_bytes_mut()], but doesn’t do any checks at all. Read more§unsafe fn as_bytes_mut(&mut self) -> &mut [u8; { _ }]
unsafe fn as_bytes_mut(&mut self) -> &mut [u8; { _ }]
Access the underlying mutable byte representation of a data structure. Read more
impl Copy for ShardMembershipEntropy
impl EncodeLike for ShardMembershipEntropy
impl Eq for ShardMembershipEntropy
impl StructuralPartialEq for ShardMembershipEntropy
Auto Trait Implementations§
impl Freeze for ShardMembershipEntropy
impl RefUnwindSafe for ShardMembershipEntropy
impl Send for ShardMembershipEntropy
impl Sync for ShardMembershipEntropy
impl Unpin for ShardMembershipEntropy
impl UnwindSafe for ShardMembershipEntropy
Blanket Implementations§
§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8] ⓘ
§impl<T, U> AsMutByteSlice<T> for U
impl<T, U> AsMutByteSlice<T> for U
fn as_mut_byte_slice(&mut self) -> &mut [u8] ⓘ
§impl<U> AsMutSliceOf for U
impl<U> AsMutSliceOf for U
fn as_mut_slice_of<T>(&mut self) -> Result<&mut [T], Error>where
T: FromByteSlice,
§impl<U> AsSliceOf for U
impl<U> AsSliceOf for U
fn as_slice_of<T>(&self) -> Result<&[T], Error>where
T: FromByteSlice,
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,
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Decode
Self and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
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§impl<T> IoType for Twhere
T: TrivialType,
impl<T> IoType for Twhere
T: TrivialType,
§const METADATA: &'static [u8] = T::METADATA
const METADATA: &'static [u8] = T::METADATA
Data structure metadata in binary form, describing shape and types of the contents, see
IoTypeMetadataKind for encoding details§type PointerType = T
type PointerType = T
Pointer with a trivial type that this
IoType represents§unsafe fn from_ptr<'a>(
ptr: &'a NonNull<<T as IoType>::PointerType>,
size: &'a u32,
capacity: u32,
) -> impl Deref<Target = T> + 'a
unsafe fn from_ptr<'a>( ptr: &'a NonNull<<T as IoType>::PointerType>, size: &'a u32, capacity: u32, ) -> impl Deref<Target = T> + 'a
Create a reference to a type, which is represented by provided memory. Read more
§unsafe fn from_mut_ptr<'a>(
ptr: &'a mut NonNull<<T as IoType>::PointerType>,
_size: &'a mut u32,
capacity: u32,
) -> impl DerefMut + 'a
unsafe fn from_mut_ptr<'a>( ptr: &'a mut NonNull<<T as IoType>::PointerType>, _size: &'a mut u32, capacity: u32, ) -> impl DerefMut + 'a
Create a mutable reference to a type, which is represented by provided memory. Read more
§unsafe fn as_ptr(
&self,
) -> impl Deref<Target = NonNull<<T as IoType>::PointerType>>
unsafe fn as_ptr( &self, ) -> impl Deref<Target = NonNull<<T as IoType>::PointerType>>
Get a raw pointer to the underlying data with no checks. Read more
§unsafe fn as_mut_ptr(&mut self) -> impl DerefMut
unsafe fn as_mut_ptr(&mut self) -> impl DerefMut
Get an exclusive raw pointer to the underlying data with no checks. Read more
§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere
T: Codec,
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)