subspace_proof_of_space

Trait TableGenerator

source
pub trait TableGenerator<T: Table>:
    Debug
    + Default
    + Clone
    + Send
    + Sized
    + 'static {
    // Required method
    fn generate(&mut self, seed: &PosSeed) -> T;

    // Provided method
    fn generate_parallel(&mut self, seed: &PosSeed) -> T { ... }
}
Expand description

Stateful table generator with better performance

Required Methods§

source

fn generate(&mut self, seed: &PosSeed) -> T

Generate new table with 32 bytes seed.

There is also Self::generate_parallel() that can achieve lower latency.

Provided Methods§

source

fn generate_parallel(&mut self, seed: &PosSeed) -> T

Generate new table with 32 bytes seed using parallelism.

This implementation will trade efficiency of CPU and memory usage for lower latency, prefer Self::generate() unless lower latency is critical.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§