Enum bdk::keys::ExtendedKey

source ·
pub enum ExtendedKey<Ctx: ScriptContext = Legacy> {
    Private((Xpriv, PhantomData<Ctx>)),
    Public((Xpub, PhantomData<Ctx>)),
}
Expand description

Enum for extended keys that can be either xprv or xpub

An instance of ExtendedKey can be constructed from an Xpriv or an Xpub by using the From trait.

Defaults to the Legacy context.

Variants§

§

Private((Xpriv, PhantomData<Ctx>))

A private extended key, aka an xprv

§

Public((Xpub, PhantomData<Ctx>))

A public extended key, aka an xpub

Implementations§

Return whether or not the key contains the private data

Transform the ExtendedKey into an Xpriv for the given [Network], if the key contains the private data

Transform the ExtendedKey into an Xpub for the given [Network]

Trait Implementations§

Identity conversion

Consume self and turn it into an ExtendedKey
Consume self and turn it into a DescriptorKey by adding the extra metadata, such as key origin and derivation path Read more
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.