Struct coins_bip32::path::DerivationPath[][src]

pub struct DerivationPath(_);

A Bip32 derivation path

Implementations

impl DerivationPath[src]

pub fn last(&self) -> Option<&u32>[src]

Return the last index in the path. None if the path is the root.

pub fn derivation_string(&self) -> String[src]

Converts the path to a standard bip32 string. e.g "m/44'/0'/0/32".

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

Returns True if there are no indices in the path

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

The number of derivations in the path

pub fn iter(&self) -> Iter<'_, u32>[src]

Make an iterator over the path indices

pub fn starts_with(&self, other: &Self) -> bool[src]

true if other is a prefix of self

pub fn without_prefix(&self, prefix: &Self) -> Option<DerivationPath>[src]

Remove a prefix from a derivation. Return a new DerivationPath without the prefix. This is useful for determining the path to rech some descendant from some ancestor.

pub fn last_hardened(&self) -> (usize, Option<u32>)[src]

Convenience function for finding the last hardened derivation in a path. Returns the index and the element. If there is no hardened derivation, it will return (0, None).

pub fn resized(&self, size: usize, pad_with: u32) -> Self[src]

Return a clone with a resized path. If the new size is shorter, this truncates it. If the new path is longer, we pad with the second argument.

pub fn extended(&self, idx: u32) -> Self[src]

Append an additional derivation to the end, return a clone

Trait Implementations

impl Clone for DerivationPath[src]

impl Debug for DerivationPath[src]

impl Default for DerivationPath[src]

impl<'de> Deserialize<'de> for DerivationPath[src]

impl Eq for DerivationPath[src]

impl From<&'_ [u32]> for DerivationPath[src]

impl From<&'_ DerivationPath> for DerivationPath[src]

impl From<&'_ Vec<u32, Global>> for DerivationPath[src]

impl From<Vec<u32, Global>> for DerivationPath[src]

impl FromIterator<u32> for DerivationPath[src]

impl FromStr for DerivationPath[src]

type Err = Bip32Error

The associated error which can be returned from parsing.

impl PartialEq<DerivationPath> for DerivationPath[src]

impl Serialize for DerivationPath[src]

impl StructuralEq for DerivationPath[src]

impl StructuralPartialEq for DerivationPath[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

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

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

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.