pub struct Tables<const K: u8>{ /* private fields */ }
Expand description
Collection of Chia tables
Implementations§
Source§impl<const K: u8> Tables<K>where
Self: Supported,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
[(); { _ }]:,
impl<const K: u8> Tables<K>where
Self: Supported,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
EvaluatableUsize<{ _ }>: Sized,
[(); { _ }]:,
Sourcepub fn create(seed: [u8; 32], cache: &TablesCache) -> Self
pub fn create(seed: [u8; 32], cache: &TablesCache) -> Self
Create Chia proof of space tables.
There is also Self::create_parallel()
that can achieve higher performance and lower
latency at the cost of lower CPU efficiency and higher memory usage.
Sourcepub fn create_proofs(seed: [u8; 32], cache: &TablesCache) -> Box<Proofs<K>>
pub fn create_proofs(seed: [u8; 32], cache: &TablesCache) -> Box<Proofs<K>>
Create proofs.
This is an optimized combination of Self::create()
and Self::find_proof()
.
There is also Self::create_proofs_parallel()
that can achieve higher performance and lower
latency at the cost of lower CPU efficiency and higher memory usage.
Sourcepub fn create_parallel(seed: [u8; 32], cache: &TablesCache) -> Self
pub fn create_parallel(seed: [u8; 32], cache: &TablesCache) -> Self
Almost the same as Self::create()
, but uses parallelism internally for better
performance and lower latency at the cost of lower CPU efficiency and higher memory usage
Sourcepub fn create_proofs_parallel(
seed: [u8; 32],
cache: &TablesCache,
) -> Box<Proofs<K>>
pub fn create_proofs_parallel( seed: [u8; 32], cache: &TablesCache, ) -> Box<Proofs<K>>
Almost the same as Self::create_proofs()
, but uses parallelism internally for better
performance and lower latency at the cost of lower CPU efficiency and higher memory usage
Sourcepub fn find_quality<'a>(
&'a self,
challenge: &'a [u8; 32],
) -> impl Iterator<Item = [u8; 32]> + 'a
pub fn find_quality<'a>( &'a self, challenge: &'a [u8; 32], ) -> impl Iterator<Item = [u8; 32]> + 'a
Find proof of space quality for a given challenge
Sourcepub fn find_proof_raw<'a>(
&'a self,
first_k_challenge_bits: u32,
) -> impl Iterator<Item = [u8; { _ }]> + 'a
pub fn find_proof_raw<'a>( &'a self, first_k_challenge_bits: u32, ) -> impl Iterator<Item = [u8; { _ }]> + 'a
Similar to Self::find_proof()
, but takes the first k
challenge bits in the least
significant bits of u32
as a challenge instead
Sourcepub fn find_proof<'a>(
&'a self,
first_challenge_bytes: [u8; 4],
) -> impl Iterator<Item = [u8; { _ }]> + 'a
pub fn find_proof<'a>( &'a self, first_challenge_bytes: [u8; 4], ) -> impl Iterator<Item = [u8; { _ }]> + 'a
Find proof of space for a given challenge
Trait Implementations§
Auto Trait Implementations§
impl<const K: u8> Freeze for Tables<K>where
EvaluatableUsize<{ metadata_size_bytes(K, 7) }>: Sized,
impl<const K: u8> RefUnwindSafe for Tables<K>where
EvaluatableUsize<{ metadata_size_bytes(K, 7) }>: Sized,
impl<const K: u8> Send for Tables<K>where
EvaluatableUsize<{ metadata_size_bytes(K, 7) }>: Sized,
impl<const K: u8> Sync for Tables<K>where
EvaluatableUsize<{ metadata_size_bytes(K, 7) }>: Sized,
impl<const K: u8> Unpin for Tables<K>where
EvaluatableUsize<{ metadata_size_bytes(K, 7) }>: Sized,
impl<const K: u8> UnwindSafe for Tables<K>where
EvaluatableUsize<{ metadata_size_bytes(K, 7) }>: Sized,
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> 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