[][src]Struct bitcoin::util::bip32::DerivationPath

pub struct DerivationPath(_);

A BIP-32 derivation path.

Methods

impl DerivationPath[src]

pub fn len(&self) -> usize[src]

Returns length of the derivation path

pub fn master() -> DerivationPath[src]

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

pub fn is_master(&self) -> bool[src]

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

pub fn child(&self, cn: ChildNumber) -> DerivationPath[src]

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

pub fn into_child(self, cn: ChildNumber) -> DerivationPath[src]

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

Important traits for DerivationPathIterator<'a>
pub fn children_from(&self, cn: ChildNumber) -> DerivationPathIterator[src]

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

Important traits for DerivationPathIterator<'a>
pub fn normal_children(&self) -> DerivationPathIterator[src]

Get an [Iterator] over the unhardened children of this [DerivationPath].

Important traits for DerivationPathIterator<'a>
pub fn hardened_children(&self) -> DerivationPathIterator[src]

Get an [Iterator] over the hardened children of this [DerivationPath].

pub fn extend<T: AsRef<[ChildNumber]>>(&self, path: T) -> DerivationPath[src]

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

impl From<Vec<ChildNumber>> for DerivationPath[src]

impl<'a> From<&'a [ChildNumber]> for DerivationPath[src]

impl AsRef<[ChildNumber]> for DerivationPath[src]

impl Ord for DerivationPath[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl PartialOrd<DerivationPath> for DerivationPath[src]

impl Default for DerivationPath[src]

impl<'a> IntoIterator for &'a DerivationPath[src]

type Item = &'a ChildNumber

The type of the elements being iterated over.

type IntoIter = Iter<'a, ChildNumber>

Which kind of iterator are we turning this into?

impl Into<Vec<ChildNumber>> for DerivationPath[src]

impl Clone for DerivationPath[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<DerivationPath> for DerivationPath[src]

impl Eq for DerivationPath[src]

impl Display for DerivationPath[src]

impl Debug for DerivationPath[src]

impl Index<usize> for DerivationPath[src]

type Output = ChildNumber

The returned type after indexing.

impl Index<Range<usize>> for DerivationPath[src]

type Output = [ChildNumber]

The returned type after indexing.

impl Index<RangeTo<usize>> for DerivationPath[src]

type Output = [ChildNumber]

The returned type after indexing.

impl Index<RangeFrom<usize>> for DerivationPath[src]

type Output = [ChildNumber]

The returned type after indexing.

impl Index<RangeFull> for DerivationPath[src]

type Output = [ChildNumber]

The returned type after indexing.

impl Hash for DerivationPath[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl FromIterator<ChildNumber> for DerivationPath[src]

impl FromStr for DerivationPath[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Unpin for DerivationPath

impl Sync for DerivationPath

impl Send for DerivationPath

impl UnwindSafe for DerivationPath

impl RefUnwindSafe for DerivationPath

Blanket Implementations

impl<T> IntoDerivationPath for T where
    T: Into<DerivationPath>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]