pub struct Tables<const K: u8>where
Self: Supported,{ /* private fields */ }Expand description
Collection of Chia tables
Implementations§
Source§impl<const K: u8> Tables<K>where
Self: Supported,
impl<const K: u8> Tables<K>where
Self: Supported,
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(
&self,
first_k_challenge_bits: u32,
) -> impl Iterator<Item = [u8; _]> + '_
pub fn find_proof_raw( &self, first_k_challenge_bits: u32, ) -> impl Iterator<Item = [u8; _]> + '_
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(
&self,
first_challenge_bytes: [u8; 4],
) -> impl Iterator<Item = [u8; _]> + '_
pub fn find_proof( &self, first_challenge_bytes: [u8; 4], ) -> impl Iterator<Item = [u8; _]> + '_
Find proof of space for a given challenge
Trait Implementations§
Auto Trait Implementations§
impl<const K: u8> Freeze for Tables<K>
impl<const K: u8> RefUnwindSafe for Tables<K>where
PrunedTable<K, 2>: RefUnwindSafe,
PrunedTable<K, 3>: RefUnwindSafe,
PrunedTable<K, 4>: RefUnwindSafe,
PrunedTable<K, 5>: RefUnwindSafe,
PrunedTable<K, 6>: RefUnwindSafe,
Table<K, 7>: RefUnwindSafe,
impl<const K: u8> Send for Tables<K>
impl<const K: u8> Sync for Tables<K>
impl<const K: u8> Unpin for Tables<K>
impl<const K: u8> UnsafeUnpin for Tables<K>where
PrunedTable<K, 2>: UnsafeUnpin,
PrunedTable<K, 3>: UnsafeUnpin,
PrunedTable<K, 4>: UnsafeUnpin,
PrunedTable<K, 5>: UnsafeUnpin,
PrunedTable<K, 6>: UnsafeUnpin,
Table<K, 7>: UnsafeUnpin,
impl<const K: u8> UnwindSafe for Tables<K>where
PrunedTable<K, 2>: UnwindSafe,
PrunedTable<K, 3>: UnwindSafe,
PrunedTable<K, 4>: UnwindSafe,
PrunedTable<K, 5>: UnwindSafe,
PrunedTable<K, 6>: UnwindSafe,
Table<K, 7>: 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> 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