pub struct Ratifications<N: Network> { /* private fields */ }
Implementations§
Source§impl<N: Network> Ratifications<N>
impl<N: Network> Ratifications<N>
Sourcepub fn to_ratifications_root(&self) -> Result<Field<N>>
pub fn to_ratifications_root(&self) -> Result<Field<N>>
Returns the ratifications root, by computing the root for a Merkle tree of the ratification IDs.
Sourcepub fn to_path(
&self,
ratification_id: N::RatificationID,
) -> Result<RatificationsPath<N>>
pub fn to_path( &self, ratification_id: N::RatificationID, ) -> Result<RatificationsPath<N>>
Returns the Merkle path for the ratifications leaf.
Sourcepub fn to_tree(&self) -> Result<RatificationsTree<N>>
pub fn to_tree(&self) -> Result<RatificationsTree<N>>
The Merkle tree of ratification IDs for the block.
Source§impl<N: Network> Ratifications<N>
impl<N: Network> Ratifications<N>
Sourcepub fn try_from_iter<T: IntoIterator<Item = Ratify<N>>>(iter: T) -> Result<Self>
pub fn try_from_iter<T: IntoIterator<Item = Ratify<N>>>(iter: T) -> Result<Self>
Initializes from an iterator of ratifications.
Source§impl<N: Network> Ratifications<N>
impl<N: Network> Ratifications<N>
Sourcepub fn contains(&self, ratification_id: &N::RatificationID) -> bool
pub fn contains(&self, ratification_id: &N::RatificationID) -> bool
Returns true
if the ratifications contains the given commitment.
Sourcepub fn get(&self, ratification_id: &N::RatificationID) -> Option<&Ratify<N>>
pub fn get(&self, ratification_id: &N::RatificationID) -> Option<&Ratify<N>>
Returns the ratification for the given ratification ID.
Source§impl<N: Network> Ratifications<N>
impl<N: Network> Ratifications<N>
Sourcepub const MAX_RATIFICATIONS: usize = 65_536usize
pub const MAX_RATIFICATIONS: usize = 65_536usize
The maximum number of ratifications allowed in a block.
Sourcepub fn iter(&self) -> impl '_ + ExactSizeIterator<Item = &Ratify<N>>
pub fn iter(&self) -> impl '_ + ExactSizeIterator<Item = &Ratify<N>>
Returns an iterator over all ratifications, for all ratifications in self
.
Sourcepub fn par_iter(&self) -> impl '_ + ParallelIterator<Item = &Ratify<N>>
pub fn par_iter(&self) -> impl '_ + ParallelIterator<Item = &Ratify<N>>
Returns a parallel iterator over all ratifications, for all ratifications in self
.
Sourcepub fn ratification_ids(
&self,
) -> impl '_ + ExactSizeIterator<Item = &N::RatificationID>
pub fn ratification_ids( &self, ) -> impl '_ + ExactSizeIterator<Item = &N::RatificationID>
Returns an iterator over the ratification IDs, for all ratifications in self
.
Source§impl<N: Network> Ratifications<N>
impl<N: Network> Ratifications<N>
Sourcepub fn into_ratification_ids(
self,
) -> impl ExactSizeIterator<Item = N::RatificationID>
pub fn into_ratification_ids( self, ) -> impl ExactSizeIterator<Item = N::RatificationID>
Returns a consuming iterator over the ratification IDs, for all ratifications in self
.
Trait Implementations§
Source§impl<N: Clone + Network> Clone for Ratifications<N>where
N::RatificationID: Clone,
impl<N: Clone + Network> Clone for Ratifications<N>where
N::RatificationID: Clone,
Source§fn clone(&self) -> Ratifications<N>
fn clone(&self) -> Ratifications<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<N: Network> Debug for Ratifications<N>
impl<N: Network> Debug for Ratifications<N>
Source§impl<'de, N: Network> Deserialize<'de> for Ratifications<N>
impl<'de, N: Network> Deserialize<'de> for Ratifications<N>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the ratifications from a JSON-string or buffer.
Source§impl<N: Network> Display for Ratifications<N>
impl<N: Network> Display for Ratifications<N>
Source§impl<N: Network> FromBytes for Ratifications<N>
impl<N: Network> FromBytes for Ratifications<N>
Source§impl<N: Network> FromStr for Ratifications<N>
impl<N: Network> FromStr for Ratifications<N>
Source§impl<N: Network> IntoIterator for Ratifications<N>
impl<N: Network> IntoIterator for Ratifications<N>
Source§fn into_iter(self) -> Self::IntoIter
fn into_iter(self) -> Self::IntoIter
Returns a consuming iterator over all ratifications, for all ratifications in self
.
Source§type IntoIter = IntoValues<<N as Network>::RatificationID, <Ratifications<N> as IntoIterator>::Item>
type IntoIter = IntoValues<<N as Network>::RatificationID, <Ratifications<N> as IntoIterator>::Item>
Source§impl<N: PartialEq + Network> PartialEq for Ratifications<N>where
N::RatificationID: PartialEq,
impl<N: PartialEq + Network> PartialEq for Ratifications<N>where
N::RatificationID: PartialEq,
Source§impl<N: Network> Serialize for Ratifications<N>
impl<N: Network> Serialize for Ratifications<N>
Source§impl<N: Network> ToBytes for Ratifications<N>
impl<N: Network> ToBytes for Ratifications<N>
impl<N: Eq + Network> Eq for Ratifications<N>where
N::RatificationID: Eq,
impl<N: Network> StructuralPartialEq for Ratifications<N>
Auto Trait Implementations§
impl<N> Freeze for Ratifications<N>
impl<N> RefUnwindSafe for Ratifications<N>where
<N as Network>::RatificationID: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
impl<N> Send for Ratifications<N>
impl<N> Sync for Ratifications<N>
impl<N> Unpin for Ratifications<N>
impl<N> UnwindSafe for Ratifications<N>where
<N as Network>::RatificationID: UnwindSafe,
<N as Environment>::Field: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
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<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
fn take_from_value<D>(
value: &mut Value,
field: &str,
) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
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§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