Struct coins_bip32::path::DerivationPath
source · [−]pub struct DerivationPath(_);
Expand description
A Bip32 derivation path
Implementations
sourceimpl 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
sourceimpl Clone for DerivationPath
impl Clone for DerivationPath
sourcefn clone(&self) -> DerivationPath
fn clone(&self) -> DerivationPath
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for DerivationPath
impl Debug for DerivationPath
sourceimpl Default for DerivationPath
impl Default for DerivationPath
sourcefn default() -> DerivationPath
fn default() -> DerivationPath
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for DerivationPath
impl<'de> Deserialize<'de> for DerivationPath
sourcefn 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
sourceimpl From<&[u32]> for DerivationPath
impl From<&[u32]> for DerivationPath
sourceimpl From<&DerivationPath> for DerivationPath
impl From<&DerivationPath> for DerivationPath
sourcefn from(v: &DerivationPath) -> Self
fn from(v: &DerivationPath) -> Self
Converts to this type from the input type.
sourceimpl FromIterator<u32> for DerivationPath
impl FromIterator<u32> for DerivationPath
sourcefn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = u32>,
fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = u32>,
Creates a value from an iterator. Read more
sourceimpl FromStr for DerivationPath
impl FromStr for DerivationPath
sourceimpl PartialEq<DerivationPath> for DerivationPath
impl PartialEq<DerivationPath> for DerivationPath
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &DerivationPath) -> bool
fn ne(&self, other: &DerivationPath) -> bool
This method tests for !=
.
sourceimpl Serialize for DerivationPath
impl Serialize 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more