pub trait CanSample<T> {
// Required method
fn sample(&mut self) -> T;
// Provided methods
fn sample_array<const N: usize>(&mut self) -> [T; N] { ... }
fn sample_vec(&mut self, n: usize) -> Vec<T> { ... }
}
Required Methods§
Provided Methods§
fn sample_array<const N: usize>(&mut self) -> [T; N]
fn sample_vec(&mut self, n: usize) -> Vec<T>
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.