Skip to main content

GenerateKey

Trait GenerateKey 

Source
pub trait GenerateKey: Sized {
    // Required method
    fn generate() -> Result<Self, InternalError>;
}
Expand description

GenerateKey

Marker trait for primary-key types that can be generated locally. This is intentionally not implemented for externally supplied keys (for example Principal, String, or small numeric primitives).

Required Methods§

Source

fn generate() -> Result<Self, InternalError>

Generate a new key value for the implementing primary-key type.

§Errors

Returns an internal generation error when the runtime cannot obtain entropy or exhausts the generator’s monotonic sequence.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§