Struct coins_bip32::path::DerivationPath
source · pub struct DerivationPath(_);
Expand description
A Bip32 derivation path
Implementations§
source§impl DerivationPath
impl DerivationPath
sourcepub fn last(&self) -> Option<&u32>
pub fn last(&self) -> Option<&u32>
Return the last index in the path. None if the path is the root.
sourcepub fn derivation_string(&self) -> String
pub fn derivation_string(&self) -> String
Converts the path to a standard bip32 string. e.g "m/44'/0'/0/32"
.
sourcepub fn starts_with(&self, other: &Self) -> bool
pub fn starts_with(&self, other: &Self) -> bool
true
if other
is a prefix of self
sourcepub fn without_prefix(&self, prefix: &Self) -> Option<DerivationPath>
pub fn without_prefix(&self, prefix: &Self) -> Option<DerivationPath>
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.
sourcepub fn last_hardened(&self) -> (usize, Option<u32>)
pub fn last_hardened(&self) -> (usize, Option<u32>)
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).
Trait Implementations§
source§impl Clone for DerivationPath
impl Clone for DerivationPath
source§fn clone(&self) -> DerivationPath
fn clone(&self) -> DerivationPath
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DerivationPath
impl Debug for DerivationPath
source§impl Default for DerivationPath
impl Default for DerivationPath
source§fn default() -> DerivationPath
fn default() -> DerivationPath
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for DerivationPath
impl<'de> Deserialize<'de> for DerivationPath
source§fn deserialize<D>(deserializer: D) -> Result<DerivationPath, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<DerivationPath, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<&[u32]> for DerivationPath
impl From<&[u32]> for DerivationPath
source§impl From<&DerivationPath> for DerivationPath
impl From<&DerivationPath> for DerivationPath
source§fn from(v: &DerivationPath) -> Self
fn from(v: &DerivationPath) -> Self
Converts to this type from the input type.
source§impl FromIterator<u32> for DerivationPath
impl FromIterator<u32> for DerivationPath
source§impl FromStr for DerivationPath
impl FromStr for DerivationPath
source§impl PartialEq<DerivationPath> for DerivationPath
impl PartialEq<DerivationPath> for DerivationPath
source§fn eq(&self, other: &DerivationPath) -> bool
fn eq(&self, other: &DerivationPath) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for DerivationPath
impl Serialize for DerivationPath
source§impl TryFrom<&str> for DerivationPath
impl TryFrom<&str> for DerivationPath
source§impl TryFrom<u32> for DerivationPath
impl TryFrom<u32> for DerivationPath
impl Eq for DerivationPath
impl StructuralEq for DerivationPath
impl StructuralPartialEq for DerivationPath
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more