pub trait Generator {
// Required method
fn generate() -> Result<Self, BwError>
where Self: Sized;
}Expand description
The Generator trait defines a common interface for types that require
a generation phase, typically resulting in the instantiation of a unique
or random state.
§Example
let generated_key = EdDsaKey::generate().expect("Key generation failed");Implementing Generator trait for your own types enables the structured
creation of instances, particularly in cryptographic or secure contexts
where randomness or uniqueness is crucial.