bdk_wallet::keys

Trait GeneratableDefaultOptions

Source
pub trait GeneratableDefaultOptions<Ctx>: GeneratableKey<Ctx>
where Ctx: ScriptContext, <Self as GeneratableKey<Ctx>>::Options: Default,
{ // Provided methods fn generate_with_entropy_default( entropy: Self::Entropy, ) -> Result<GeneratedKey<Self, Ctx>, Self::Error> { ... } fn generate_default() -> Result<GeneratedKey<Self, Ctx>, Self::Error> { ... } fn generate_default_with_aux_rand( rng: &mut (impl CryptoRng + RngCore), ) -> Result<GeneratedKey<Self, Ctx>, Self::Error> { ... } }
Expand description

Trait that allows generating a key with the default options

This trait is automatically implemented if the GeneratableKey::Options implements Default.

Provided Methods§

Source

fn generate_with_entropy_default( entropy: Self::Entropy, ) -> Result<GeneratedKey<Self, Ctx>, Self::Error>

Generate a key with the default options and a given entropy

Source

fn generate_default() -> Result<GeneratedKey<Self, Ctx>, Self::Error>

Generate a key with the default options and a random entropy

Uses the thread-local random number generator.

Source

fn generate_default_with_aux_rand( rng: &mut (impl CryptoRng + RngCore), ) -> Result<GeneratedKey<Self, Ctx>, Self::Error>

Generate a key with the default options and a random entropy

Uses a provided random number generator (rng).

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§

Source§

impl<Ctx, K> GeneratableDefaultOptions<Ctx> for K
where Ctx: ScriptContext, K: GeneratableKey<Ctx>, <K as GeneratableKey<Ctx>>::Options: Default,

Automatic implementation of GeneratableDefaultOptions for GeneratableKeys where Options implements Default