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§
sourcefn generate(&mut self, seed: &PosSeed) -> T
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§
sourcefn generate_parallel(&mut self, seed: &PosSeed) -> T
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.