Struct hdpath::CustomHDPath
source · [−]Expand description
A custom HD Path, that can be any length and contain any Hardened and non-Hardened values in any order. Direct implementation for BIP-32
If you need just standard type of HD Path like m/44'/0'/0'/0/0
use StandardHDPath
instead.
Usage
Parse string
use hdpath::CustomHDPath;
let hdpath = CustomHDPath::try_from("m/1'/2'/3/4/5'/6'/7").unwrap();
let hdpath = CustomHDPath::try_from("m/44'/0'/1'/0/0").unwrap();
//also support uppercase notation
let hdpath = CustomHDPath::try_from("M/44H/0H/1H/0/0").unwrap();
Direct create
use hdpath::{CustomHDPath, PathValue};
let hdpath = CustomHDPath::try_new(vec![
PathValue::hardened(44), PathValue::hardened(0), PathValue::hardened(1),
PathValue::normal(0), PathValue::normal(0)
]).unwrap();
Tuple Fields
0: Vec<PathValue>
Implementations
sourceimpl CustomHDPath
impl CustomHDPath
Trait Implementations
sourceimpl Clone for CustomHDPath
impl Clone for CustomHDPath
sourcefn clone(&self) -> CustomHDPath
fn clone(&self) -> CustomHDPath
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 CustomHDPath
impl Debug for CustomHDPath
sourceimpl Display for CustomHDPath
impl Display for CustomHDPath
sourceimpl From<&'_ (dyn HDPath + '_)> for CustomHDPath
impl From<&'_ (dyn HDPath + '_)> for CustomHDPath
sourceimpl From<StandardHDPath> for CustomHDPath
impl From<StandardHDPath> for CustomHDPath
sourcefn from(value: StandardHDPath) -> Self
fn from(value: StandardHDPath) -> Self
Converts to this type from the input type.
sourceimpl FromStr for CustomHDPath
impl FromStr for CustomHDPath
sourceimpl HDPath for CustomHDPath
impl HDPath for CustomHDPath
sourcefn get(&self, pos: u8) -> Option<PathValue>
fn get(&self, pos: u8) -> Option<PathValue>
Get element as the specified position.
The implementation must return Some<PathValue>
for all values up to len()
.
And return None
if the position if out of bounds. Read more
sourcefn to_bytes(&self) -> Vec<u8>
fn to_bytes(&self) -> Vec<u8>
Encode as bytes, where first byte is number of elements in path (always 5 for StandardHDPath) following by 4-byte BE values Read more
sourcefn parent(&self) -> Option<CustomHDPath>
fn parent(&self) -> Option<CustomHDPath>
Get parent HD Path.
Return None
if the current path is empty (i.e. already at the top) Read more
sourcefn as_custom(&self) -> CustomHDPath
fn as_custom(&self) -> CustomHDPath
Convert current to CustomHDPath
structure Read more
sourceimpl PartialEq<CustomHDPath> for CustomHDPath
impl PartialEq<CustomHDPath> for CustomHDPath
sourcefn eq(&self, other: &CustomHDPath) -> bool
fn eq(&self, other: &CustomHDPath) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CustomHDPath) -> bool
fn ne(&self, other: &CustomHDPath) -> bool
This method tests for !=
.
sourceimpl TryFrom<&'_ str> for CustomHDPath
impl TryFrom<&'_ str> for CustomHDPath
sourceimpl TryFrom<CustomHDPath> for AccountHDPath
impl TryFrom<CustomHDPath> for AccountHDPath
sourceimpl TryFrom<CustomHDPath> for StandardHDPath
impl TryFrom<CustomHDPath> for StandardHDPath
impl Eq for CustomHDPath
impl StructuralEq for CustomHDPath
impl StructuralPartialEq for CustomHDPath
Auto Trait Implementations
impl RefUnwindSafe for CustomHDPath
impl Send for CustomHDPath
impl Sync for CustomHDPath
impl Unpin for CustomHDPath
impl UnwindSafe for CustomHDPath
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