Tables

Struct Tables 

Source
pub struct Tables<const K: u8>
where Self: Supported, EvaluatableUsize<{ _ }>: Sized, [(); { _ }]:,
{ /* 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, [(); { _ }]:,

Source

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.

Source

pub fn create_proofs(seed: [u8; 32], cache: &TablesCache) -> Box<Proofs<K>>
where [(); { _ }]:,

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.

Source

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

Source

pub fn create_proofs_parallel( seed: [u8; 32], cache: &TablesCache, ) -> Box<Proofs<K>>
where [(); { _ }]:,

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

Source

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

Source

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

Source

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

Source

pub fn verify_only_raw( seed: &[u8; 32], first_k_challenge_bits: u32, proof_of_space: &[u8; { _ }], ) -> bool

Similar to Self::verify(), but takes the first k challenge bits in the least significant bits of u32 as a challenge instead and doesn’t compute quality

Source

pub fn verify( seed: &[u8; 32], challenge: &[u8; 32], proof_of_space: &[u8; { _ }], ) -> Option<[u8; 32]>
where EvaluatableUsize<{ _ }>: Sized,

Verify proof of space for a given seed and challenge

Trait Implementations§

Source§

impl<const K: u8> Debug for Tables<K>
where Self: Supported, EvaluatableUsize<{ _ }>: Sized, [(); { _ }]:,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> JsonSchemaMaybe for T