pub struct DerivationPath(/* private fields */);
Expand description
A list of ChildIndex items
Implementations§
Source§impl DerivationPath
impl DerivationPath
Sourcepub fn new<P>(path: P) -> Self
pub fn new<P>(path: P) -> Self
Build a DerivationPath from a list of ChildIndex items
Sourcepub fn bip32<P>(path: P) -> Result<Self, DerivationPathError>
pub fn bip32<P>(path: P) -> Result<Self, DerivationPathError>
Build a BIP32 style DerivationPath. This will fail if the length of the path is greater than 255 items
Sourcepub fn bip44(
coin: u32,
account: u32,
change: u32,
address: u32,
) -> Result<Self, DerivationPathError>
pub fn bip44( coin: u32, account: u32, change: u32, address: u32, ) -> Result<Self, DerivationPathError>
Build a BIP44 style DerivationPath: m/44'/coin'/account'/change/address
Sourcepub fn bip49(
coin: u32,
account: u32,
change: u32,
address: u32,
) -> Result<Self, DerivationPathError>
pub fn bip49( coin: u32, account: u32, change: u32, address: u32, ) -> Result<Self, DerivationPathError>
Build a BIP49 style DerivationPath: m/49'/coin'/account'/change/address
Sourcepub fn path(&self) -> &[ChildIndex]
pub fn path(&self) -> &[ChildIndex]
Get a reference to the list of ChildIndex items
Sourcepub fn path_type(&self) -> DerivationPathType
pub fn path_type(&self) -> DerivationPathType
Get the DerivationPathType. This will check the “purpose” index in BIP44/49 style derivation paths or otherwise return BIP32 if the length is less than 255
Trait Implementations§
Source§impl AsRef<[ChildIndex]> for DerivationPath
impl AsRef<[ChildIndex]> for DerivationPath
Source§fn as_ref(&self) -> &[ChildIndex]
fn as_ref(&self) -> &[ChildIndex]
Converts this type into a shared reference of the (usually inferred) input type.
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 Display for DerivationPath
impl Display for DerivationPath
Source§impl FromStr for DerivationPath
impl FromStr for DerivationPath
Source§impl<'a> IntoIterator for &'a DerivationPath
impl<'a> IntoIterator for &'a DerivationPath
Source§impl PartialEq for DerivationPath
impl PartialEq for DerivationPath
impl Eq for DerivationPath
impl StructuralPartialEq for DerivationPath
Auto Trait Implementations§
impl Freeze for DerivationPath
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