bdkffi::keys

Struct DerivationPath

Source
pub struct DerivationPath(/* private fields */);
Expand description

A BIP-32 derivation path.

Implementations§

Source§

impl DerivationPath

Source

pub fn new(path: String) -> Result<Self, Bip32Error>

Parse a string as a BIP-32 derivation path.

Source

pub fn master() -> Arc<Self>

Returns derivation path for a master key (i.e. empty derivation path)

Source

pub fn is_master(&self) -> bool

Returns whether derivation path represents master key (i.e. it’s length is empty). True for m path.

Source

pub fn len(&self) -> u64

Returns length of the derivation path

Source

pub fn is_empty(&self) -> bool

Returns true if the derivation path is empty

Source

pub fn child(&self, child_number: ChildNumber) -> Result<Arc<Self>, Bip32Error>

Create a new DerivationPath that is a child of this one.

Source

pub fn extend(&self, other: &DerivationPath) -> Arc<Self>

Concatenate self with path and return the resulting new path.

Source

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

Source§

fn clone(&self) -> DerivationPath

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DerivationPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DerivationPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<DerivationPath> for DerivationPath

Source§

fn from(core_type: BdkDerivationPath) -> Self

Converts to this type from the input type.
Source§

impl From<DerivationPath> for DerivationPath

Source§

fn from(ffi_type: DerivationPath) -> Self

Converts to this type from the input type.
Source§

impl<UT> LiftRef<UT> for DerivationPath

Source§

impl<UT> LowerError<UT> for DerivationPath

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for DerivationPath

Source§

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>

Lower the return value from an scaffolding call Read more
§

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

Source§

const TYPE_ID_META: MetadataBuffer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoDerivationPath for T
where T: Into<DerivationPath>,

§

fn into_derivation_path(self) -> Result<DerivationPath, Error>

Converts a given type into a [DerivationPath] with possible error
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V