Enum miniscript::descriptor::DescriptorPublicKey
source · [−]pub enum DescriptorPublicKey {
Single(SinglePub),
XPub(DescriptorXKey<ExtendedPubKey>),
}
Expand description
The descriptor pubkey, either a single pubkey or an xpub.
Variants
Single(SinglePub)
Single public key.
XPub(DescriptorXKey<ExtendedPubKey>)
Extended public key (xpub).
Implementations
sourceimpl DescriptorPublicKey
impl DescriptorPublicKey
sourcepub fn master_fingerprint(&self) -> Fingerprint
pub fn master_fingerprint(&self) -> Fingerprint
The fingerprint of the master key associated with this key, 0x00000000
if none.
sourcepub fn full_derivation_path(&self) -> DerivationPath
pub fn full_derivation_path(&self) -> DerivationPath
Full path, from the master key
For wildcard keys this will return the path up to the wildcard, so you can get full paths by appending one additional derivation step, according to the wildcard type (hardened or normal)
sourcepub fn is_deriveable(&self) -> bool
👎Deprecated: use has_wildcard instead
pub fn is_deriveable(&self) -> bool
Whether or not the key has a wildcard
sourcepub fn has_wildcard(&self) -> bool
pub fn has_wildcard(&self) -> bool
Whether or not the key has a wildcard
sourcepub fn derive(self, index: u32) -> DefiniteDescriptorKey
👎Deprecated: use at_derivation_index instead
pub fn derive(self, index: u32) -> DefiniteDescriptorKey
Deprecated name of [at_derivation_index
].
sourcepub fn at_derivation_index(self, index: u32) -> DefiniteDescriptorKey
pub fn at_derivation_index(self, index: u32) -> DefiniteDescriptorKey
Replaces any wildcard (i.e. /*
) in the key with a particular derivation index, turning it into a
definite key (i.e. one where all the derivation paths are set).
Returns
- If this key is not an xpub, returns
self
. - If this key is an xpub but does not have a wildcard, returns
self
. - Otherwise, returns the xpub at derivation
index
(removing the wildcard).
Panics
If index
≥ 2^31
Trait Implementations
sourceimpl Clone for DescriptorPublicKey
impl Clone for DescriptorPublicKey
sourcefn clone(&self) -> DescriptorPublicKey
fn clone(&self) -> DescriptorPublicKey
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for DescriptorPublicKey
impl Debug for DescriptorPublicKey
sourceimpl Display for DescriptorPublicKey
impl Display for DescriptorPublicKey
sourceimpl From<DefiniteDescriptorKey> for DescriptorPublicKey
impl From<DefiniteDescriptorKey> for DescriptorPublicKey
sourcefn from(d: DefiniteDescriptorKey) -> Self
fn from(d: DefiniteDescriptorKey) -> Self
Converts to this type from the input type.
sourceimpl FromStr for DescriptorPublicKey
impl FromStr for DescriptorPublicKey
sourceimpl Hash for DescriptorPublicKey
impl Hash for DescriptorPublicKey
sourceimpl MiniscriptKey for DescriptorPublicKey
impl MiniscriptKey for DescriptorPublicKey
type Sha256 = Hash
type Sha256 = Hash
type Ripemd160 = Hash
type Ripemd160 = Hash
The associated [
ripedmd160::Hash
] for this MiniscriptKey
type.
used in the ripemd160 fragment Read moretype Hash160 = Hash
type Hash160 = Hash
sourcefn is_uncompressed(&self) -> bool
fn is_uncompressed(&self) -> bool
Returns true if the pubkey is uncompressed. Defaults to
false
.sourcefn is_x_only_key(&self) -> bool
fn is_x_only_key(&self) -> bool
Returns true if the pubkey is an x-only pubkey. Defaults to
false
.sourceimpl Ord for DescriptorPublicKey
impl Ord for DescriptorPublicKey
sourcefn cmp(&self, other: &DescriptorPublicKey) -> Ordering
fn cmp(&self, other: &DescriptorPublicKey) -> Ordering
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<DescriptorPublicKey> for DescriptorPublicKey
impl PartialEq<DescriptorPublicKey> for DescriptorPublicKey
sourcefn eq(&self, other: &DescriptorPublicKey) -> bool
fn eq(&self, other: &DescriptorPublicKey) -> bool
sourceimpl PartialOrd<DescriptorPublicKey> for DescriptorPublicKey
impl PartialOrd<DescriptorPublicKey> for DescriptorPublicKey
sourcefn partial_cmp(&self, other: &DescriptorPublicKey) -> Option<Ordering>
fn partial_cmp(&self, other: &DescriptorPublicKey) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for DescriptorPublicKey
impl StructuralEq for DescriptorPublicKey
impl StructuralPartialEq for DescriptorPublicKey
Auto Trait Implementations
impl RefUnwindSafe for DescriptorPublicKey
impl Send for DescriptorPublicKey
impl Sync for DescriptorPublicKey
impl Unpin for DescriptorPublicKey
impl UnwindSafe for DescriptorPublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more