pub struct DerivationPath(_);
Expand description

A BIP-32 derivation path.

Implementations

Returns length of the derivation path

Returns true if the derivation path is empty

Returns derivation path for a master key (i.e. empty derivation path)

Returns whether derivation path represents master key (i.e. it’s length is empty). True for m path.

Create a new DerivationPath that is a child of this one.

Convert into a DerivationPath that is a child of this one.

Get an Iterator over the children of this DerivationPath starting with the given ChildNumber.

Get an Iterator over the unhardened children of this DerivationPath.

Get an Iterator over the hardened children of this DerivationPath.

Concatenate self with path and return the resulting new path.

use bitcoin::util::bip32::{DerivationPath, ChildNumber};
use std::str::FromStr;

let base = DerivationPath::from_str("m/42").unwrap();

let deriv_1 = base.extend(DerivationPath::from_str("m/0/1").unwrap());
let deriv_2 = base.extend(&[
    ChildNumber::from_normal_idx(0).unwrap(),
    ChildNumber::from_normal_idx(1).unwrap()
]);

assert_eq!(deriv_1, deriv_2);

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Creates a value from an iterator. Read more
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Serialize this value into the given Serde serializer. Read more

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.

Convers a given type into a DerivationPath with possible error
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
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.