pub struct DerivationPath(/* private fields */);Expand description
A BIP-32 derivation path.
Implementations§
Source§impl DerivationPath
impl DerivationPath
Sourcepub fn new(path: String) -> Result<Self, Bip32Error>
pub fn new(path: String) -> Result<Self, Bip32Error>
Parse a string as a BIP-32 derivation path.
Sourcepub fn master() -> Arc<Self>
pub fn master() -> Arc<Self>
Returns derivation path for a master key (i.e. empty derivation path)
Sourcepub fn is_master(&self) -> bool
pub fn is_master(&self) -> bool
Returns whether derivation path represents master key (i.e. it’s length
is empty). True for m path.
Sourcepub fn child(&self, child_number: ChildNumber) -> Result<Arc<Self>, Bip32Error>
pub fn child(&self, child_number: ChildNumber) -> Result<Arc<Self>, Bip32Error>
Create a new DerivationPath that is a child of this one.
Sourcepub fn extend(&self, other: &DerivationPath) -> Arc<Self>
pub fn extend(&self, other: &DerivationPath) -> Arc<Self>
Concatenate self with path and return the resulting new path.
Sourcepub fn to_u32_vec(&self) -> Vec<u32>
pub fn to_u32_vec(&self) -> Vec<u32>
Returns the derivation path as a vector of u32 integers. Unhardened elements are copied as is. 0x80000000 is added to the hardened elements.
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 Display for DerivationPath
impl Display for DerivationPath
Source§impl From<DerivationPath> for DerivationPath
impl From<DerivationPath> for DerivationPath
Source§impl From<DerivationPath> for DerivationPath
impl From<DerivationPath> for DerivationPath
Source§fn from(ffi_type: DerivationPath) -> Self
fn from(ffi_type: DerivationPath) -> Self
Converts to this type from the input type.
Source§impl<UT> LiftRef<UT> for DerivationPath
impl<UT> LiftRef<UT> for DerivationPath
type LiftType = Arc<DerivationPath>
Source§impl<UT> LowerError<UT> for DerivationPath
impl<UT> LowerError<UT> for DerivationPath
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for DerivationPath
impl<UT> LowerReturn<UT> for DerivationPath
Source§type ReturnType = <Arc<DerivationPath> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<DerivationPath> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Source§impl<UT> TypeId<UT> for DerivationPath
impl<UT> TypeId<UT> for DerivationPath
const TYPE_ID_META: MetadataBuffer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more§impl<T> IntoDerivationPath for Twhere
T: Into<DerivationPath>,
impl<T> IntoDerivationPath for Twhere
T: Into<DerivationPath>,
§fn into_derivation_path(self) -> Result<DerivationPath, Error>
fn into_derivation_path(self) -> Result<DerivationPath, Error>
Converts a given type into a [
DerivationPath] with possible error