pub struct PathComponent { /* private fields */ }Available on crate feature
mnemonic only.Expand description
A single component of a BIP-32 derivation path.
Wraps a 31-bit numeric index plus a hardened flag. The encoded 32-bit
value used during derivation is index | 0x80000000 when hardened.
Fields are private to enforce the index < 2^31 invariant: a value with
the hardened bit already set would collide with an explicitly hardened
component during BIP-32 derivation, producing an ambiguous key. Use
Self::try_new to construct.
Implementations§
Source§impl PathComponent
impl PathComponent
Sourcepub fn try_new(index: u32, hardened: bool) -> AptosResult<Self>
pub fn try_new(index: u32, hardened: bool) -> AptosResult<Self>
Constructs a path component, rejecting any index whose top bit is
set (i.e. index >= 2^31 = 0x8000_0000).
§Errors
Returns AptosError::KeyDerivation if index has its hardened
bit set; valid BIP-32 indices are confined to 31 bits and the
hardened bit is supplied via the hardened flag.
Trait Implementations§
Source§impl Clone for PathComponent
impl Clone for PathComponent
Source§fn clone(&self) -> PathComponent
fn clone(&self) -> PathComponent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PathComponent
impl Debug for PathComponent
Source§impl PartialEq for PathComponent
impl PartialEq for PathComponent
Source§fn eq(&self, other: &PathComponent) -> bool
fn eq(&self, other: &PathComponent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for PathComponent
impl Eq for PathComponent
impl StructuralPartialEq for PathComponent
Auto Trait Implementations§
impl Freeze for PathComponent
impl RefUnwindSafe for PathComponent
impl Send for PathComponent
impl Sync for PathComponent
impl Unpin for PathComponent
impl UnsafeUnpin for PathComponent
impl UnwindSafe for PathComponent
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.