Struct bitcoin::util::bip32::DerivationPath [−][src]
pub struct DerivationPath(_);
Expand description
A BIP-32 derivation path.
Implementations
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.
pub fn children_from(&self, cn: ChildNumber) -> DerivationPathIterator<'_>ⓘNotable traits for DerivationPathIterator<'a>impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
pub fn children_from(&self, cn: ChildNumber) -> DerivationPathIterator<'_>ⓘNotable traits for DerivationPathIterator<'a>impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
Get an Iterator over the children of this DerivationPath starting with the given ChildNumber.
pub fn normal_children(&self) -> DerivationPathIterator<'_>ⓘNotable traits for DerivationPathIterator<'a>impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
pub fn normal_children(&self) -> DerivationPathIterator<'_>ⓘNotable traits for DerivationPathIterator<'a>impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
Get an Iterator over the unhardened children of this DerivationPath.
pub fn hardened_children(&self) -> DerivationPathIterator<'_>ⓘNotable traits for DerivationPathIterator<'a>impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
pub fn hardened_children(&self) -> DerivationPathIterator<'_>ⓘNotable traits for DerivationPathIterator<'a>impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
impl<'a> Iterator for DerivationPathIterator<'a> type Item = 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
Performs the conversion.
Returns the “default value” for a type. Read more
Performs the conversion.
Performs the conversion.
Creates a value from an iterator. Read more
type Output = ChildNumber
type Output = ChildNumber
The returned type after indexing.
Performs the indexing (container[index]
) operation. Read more
Performs the conversion.
type Item = &'a ChildNumber
type Item = &'a ChildNumber
The type of the elements being iterated over.
type IntoIter = Iter<'a, ChildNumber>
type IntoIter = Iter<'a, ChildNumber>
Which kind of iterator are we turning this into?
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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
Auto Trait Implementations
impl RefUnwindSafe for DerivationPath
impl Send for DerivationPath
impl Sync for DerivationPath
impl Unpin for DerivationPath
impl UnwindSafe for DerivationPath
Blanket Implementations
Mutably borrows from an owned value. Read more
Convers a given type into a DerivationPath
with possible error