Struct snarkvm_debug::prelude::coinbase::CoinbaseSolution
pub struct CoinbaseSolution<N>where
N: Network,{ /* private fields */ }Expand description
The coinbase puzzle solution is composed of individual prover solutions.
Implementations§
§impl<N> CoinbaseSolution<N>where
N: Network,
impl<N> CoinbaseSolution<N>where
N: Network,
pub fn new(
solutions: Vec<ProverSolution<N>>
) -> Result<CoinbaseSolution<N>, Error>
pub fn new( solutions: Vec<ProverSolution<N>> ) -> Result<CoinbaseSolution<N>, Error>
Initializes a new instance of the solutions.
pub fn puzzle_commitments(&self) -> impl Iterator<Item = &PuzzleCommitment<N>>
pub fn puzzle_commitments(&self) -> impl Iterator<Item = &PuzzleCommitment<N>>
Returns the puzzle commitments.
pub fn get_solution(
&self,
puzzle_commitment: &PuzzleCommitment<N>
) -> Option<&ProverSolution<N>>
pub fn get_solution( &self, puzzle_commitment: &PuzzleCommitment<N> ) -> Option<&ProverSolution<N>>
Returns the prover solution for the puzzle commitment.
pub fn to_combined_proof_target(&self) -> Result<u128, Error>
pub fn to_combined_proof_target(&self) -> Result<u128, Error>
Returns the combined sum of the prover solutions.
pub fn to_accumulator_point(&self) -> Result<Field<N>, Error>
pub fn to_accumulator_point(&self) -> Result<Field<N>, Error>
Returns the accumulator challenge point.
Methods from Deref<Target = IndexMap<PuzzleCommitment<N>, ProverSolution<N>>>§
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Return the number of elements the map can hold without reallocating.
This number is a lower bound; the map might be able to hold more, but is guaranteed to be able to hold at least this many.
Computes in O(1) time.
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Return the number of key-value pairs in the map.
Computes in O(1) time.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the map contains no elements.
Computes in O(1) time.
sourcepub fn iter(&self) -> Iter<'_, K, V>
pub fn iter(&self) -> Iter<'_, K, V>
Return an iterator over the key-value pairs of the map, in their order
sourcepub fn keys(&self) -> Keys<'_, K, V>
pub fn keys(&self) -> Keys<'_, K, V>
Return an iterator over the keys of the map, in their order
sourcepub fn values(&self) -> Values<'_, K, V>
pub fn values(&self) -> Values<'_, K, V>
Return an iterator over the values of the map, in their order
sourcepub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn contains_key<Q>(&self, key: &Q) -> bool
Return true if an equivalent to key exists in the map.
Computes in O(1) time (average).
sourcepub fn get<Q>(&self, key: &Q) -> Option<&V>
pub fn get<Q>(&self, key: &Q) -> Option<&V>
Return a reference to the value stored for key, if it is present,
else None.
Computes in O(1) time (average).
sourcepub fn get_key_value<Q>(&self, key: &Q) -> Option<(&K, &V)>
pub fn get_key_value<Q>(&self, key: &Q) -> Option<(&K, &V)>
Return references to the key-value pair stored for key,
if it is present, else None.
Computes in O(1) time (average).
sourcepub fn get_index_of<Q>(&self, key: &Q) -> Option<usize>
pub fn get_index_of<Q>(&self, key: &Q) -> Option<usize>
Return item index, if it exists in the map
Computes in O(1) time (average).
sourcepub fn as_slice(&self) -> &Slice<K, V>
pub fn as_slice(&self) -> &Slice<K, V>
Returns a slice of all the key-value pairs in the map.
Computes in O(1) time.
sourcepub fn get_index(&self, index: usize) -> Option<(&K, &V)>
pub fn get_index(&self, index: usize) -> Option<(&K, &V)>
Get a key-value pair by index
Valid indices are 0 <= index < self.len()
Computes in O(1) time.
sourcepub fn get_range<R>(&self, range: R) -> Option<&Slice<K, V>>where
R: RangeBounds<usize>,
pub fn get_range<R>(&self, range: R) -> Option<&Slice<K, V>>where
R: RangeBounds<usize>,
Returns a slice of key-value pairs in the given range of indices.
Valid indices are 0 <= index < self.len()
Computes in O(1) time.
sourcepub fn par_keys(&self) -> ParKeys<'_, K, V>
pub fn par_keys(&self) -> ParKeys<'_, K, V>
Return a parallel iterator over the keys of the map.
While parallel iterators can process items in any order, their relative order
in the map is still preserved for operations like reduce and collect.
sourcepub fn par_values(&self) -> ParValues<'_, K, V>
pub fn par_values(&self) -> ParValues<'_, K, V>
Return a parallel iterator over the values of the map.
While parallel iterators can process items in any order, their relative order
in the map is still preserved for operations like reduce and collect.
Trait Implementations§
§impl<N> Clone for CoinbaseSolution<N>
impl<N> Clone for CoinbaseSolution<N>
§fn clone(&self) -> CoinbaseSolution<N>
fn clone(&self) -> CoinbaseSolution<N>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<N> Debug for CoinbaseSolution<N>where
N: Network,
impl<N> Debug for CoinbaseSolution<N>where
N: Network,
§impl<N> Deref for CoinbaseSolution<N>where
N: Network,
impl<N> Deref for CoinbaseSolution<N>where
N: Network,
§type Target = IndexMap<PuzzleCommitment<N>, ProverSolution<N>>
type Target = IndexMap<PuzzleCommitment<N>, ProverSolution<N>>
§fn deref(&self) -> &<CoinbaseSolution<N> as Deref>::Target
fn deref(&self) -> &<CoinbaseSolution<N> as Deref>::Target
§impl<'de, N> Deserialize<'de> for CoinbaseSolution<N>where
N: Network,
impl<'de, N> Deserialize<'de> for CoinbaseSolution<N>where
N: Network,
§fn deserialize<D>(
deserializer: D
) -> Result<CoinbaseSolution<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<CoinbaseSolution<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the solutions from a JSON-string or buffer.
§impl<N> Display for CoinbaseSolution<N>where
N: Network,
impl<N> Display for CoinbaseSolution<N>where
N: Network,
§impl<N> FromBytes for CoinbaseSolution<N>where
N: Network,
impl<N> FromBytes for CoinbaseSolution<N>where
N: Network,
§impl<N> FromStr for CoinbaseSolution<N>where
N: Network,
impl<N> FromStr for CoinbaseSolution<N>where
N: Network,
§impl<N> PartialEq for CoinbaseSolution<N>
impl<N> PartialEq for CoinbaseSolution<N>
§fn eq(&self, other: &CoinbaseSolution<N>) -> bool
fn eq(&self, other: &CoinbaseSolution<N>) -> bool
self and other values to be equal, and is used
by ==.§impl<N> Serialize for CoinbaseSolution<N>where
N: Network,
impl<N> Serialize for CoinbaseSolution<N>where
N: Network,
§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serializes the solutions to a JSON-string or buffer.
§impl<N> ToBytes for CoinbaseSolution<N>where
N: Network,
impl<N> ToBytes for CoinbaseSolution<N>where
N: Network,
impl<N> Eq for CoinbaseSolution<N>
impl<N> StructuralEq for CoinbaseSolution<N>where
N: Network,
impl<N> StructuralPartialEq for CoinbaseSolution<N>where
N: Network,
Auto Trait Implementations§
impl<N> RefUnwindSafe for CoinbaseSolution<N>where
<N as Environment>::Field: RefUnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
impl<N> Send for CoinbaseSolution<N>
impl<N> Sync for CoinbaseSolution<N>
impl<N> Unpin for CoinbaseSolution<N>where
<N as Environment>::Field: Unpin,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Unpin,
<N as Environment>::Projective: Unpin,
impl<N> UnwindSafe for CoinbaseSolution<N>where
<N as Environment>::Field: UnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: 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<'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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.