pub struct RewardedSignatures(/* private fields */);
Expand description
Describes finality signatures that will be rewarded in a block. Consists of a vector of
SingleBlockRewardedSignatures
, each of which describes signatures for a single ancestor
block. The first entry represents the signatures for the parent block, the second for the
parent of the parent, and so on.
Implementations§
Source§impl RewardedSignatures
impl RewardedSignatures
Sourcepub fn new<I: IntoIterator<Item = SingleBlockRewardedSignatures>>(
single_block_signatures: I,
) -> Self
pub fn new<I: IntoIterator<Item = SingleBlockRewardedSignatures>>( single_block_signatures: I, ) -> Self
Creates a new instance of RewardedSignatures
.
Sourcepub fn pack(unpacked: Vec<Vec<u8>>) -> Self
pub fn pack(unpacked: Vec<Vec<u8>>) -> Self
Creates an instance of RewardedSignatures
based on its unpacked (one byte per validator)
representation.
Sourcepub fn unpack(&self) -> Vec<Vec<u8>>
pub fn unpack(&self) -> Vec<Vec<u8>>
Creates an unpacked (one byte per validator) representation of the finality signatures to be rewarded in this block.
Sourcepub fn left_padded(self, num_blocks: usize) -> Self
pub fn left_padded(self, num_blocks: usize) -> Self
Returns this instance of RewardedSignatures
with num_blocks
of empty signatures
prepended.
Sourcepub fn difference(self, other: &RewardedSignatures) -> Self
pub fn difference(self, other: &RewardedSignatures) -> Self
Calculates the set difference between two instances of RewardedSignatures
.
Sourcepub fn intersection(&self, other: &RewardedSignatures) -> Self
pub fn intersection(&self, other: &RewardedSignatures) -> Self
Calculates the set intersection between two instances of RewardedSignatures
.
Sourcepub fn iter(&self) -> impl Iterator<Item = &SingleBlockRewardedSignatures>
pub fn iter(&self) -> impl Iterator<Item = &SingleBlockRewardedSignatures>
Iterates over the SingleBlockRewardedSignatures
for each rewarded block.
Sourcepub fn iter_with_height(
&self,
block_height: u64,
) -> impl Iterator<Item = (u64, &SingleBlockRewardedSignatures)>
pub fn iter_with_height( &self, block_height: u64, ) -> impl Iterator<Item = (u64, &SingleBlockRewardedSignatures)>
Iterates over the SingleBlockRewardedSignatures
, yielding the signatures together with
the block height for each entry. block_height
is the height of the block that contains
this instance of RewardedSignatures
.
Trait Implementations§
Source§impl Clone for RewardedSignatures
impl Clone for RewardedSignatures
Source§fn clone(&self) -> RewardedSignatures
fn clone(&self) -> RewardedSignatures
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl DataSize for RewardedSignatures
impl DataSize for RewardedSignatures
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
true
, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
IS_DYNAMIC
is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Source§impl Debug for RewardedSignatures
impl Debug for RewardedSignatures
Source§impl Default for RewardedSignatures
impl Default for RewardedSignatures
Source§fn default() -> RewardedSignatures
fn default() -> RewardedSignatures
Source§impl<'de> Deserialize<'de> for RewardedSignatures
impl<'de> Deserialize<'de> for RewardedSignatures
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>,
Source§impl FromBytes for RewardedSignatures
impl FromBytes for RewardedSignatures
Source§impl Hash for RewardedSignatures
impl Hash for RewardedSignatures
Source§impl JsonSchema for RewardedSignatures
impl JsonSchema for RewardedSignatures
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl Ord for RewardedSignatures
impl Ord for RewardedSignatures
Source§fn cmp(&self, other: &RewardedSignatures) -> Ordering
fn cmp(&self, other: &RewardedSignatures) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RewardedSignatures
impl PartialEq for RewardedSignatures
Source§impl PartialOrd for RewardedSignatures
impl PartialOrd for RewardedSignatures
Source§impl Serialize for RewardedSignatures
impl Serialize for RewardedSignatures
Source§impl ToBytes for RewardedSignatures
impl ToBytes for RewardedSignatures
Source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Vec<u8>
which would be returned from a successful call to
to_bytes()
or into_bytes()
. The data is not actually serialized, so this call is
relatively cheap.impl Eq for RewardedSignatures
impl StructuralPartialEq for RewardedSignatures
Auto Trait Implementations§
impl Freeze for RewardedSignatures
impl RefUnwindSafe for RewardedSignatures
impl Send for RewardedSignatures
impl Sync for RewardedSignatures
impl Unpin for RewardedSignatures
impl UnwindSafe for RewardedSignatures
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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