pub struct HardenedIndex(/* private fields */);Expand description
Index for hardened children derivation; ensures that the index always >= 2^31.
Implementations§
Source§impl HardenedIndex
 
impl HardenedIndex
pub const fn hardened(child_number: u16) -> HardenedIndex
Trait Implementations§
Source§impl Clone for HardenedIndex
 
impl Clone for HardenedIndex
Source§fn clone(&self) -> HardenedIndex
 
fn clone(&self) -> HardenedIndex
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 HardenedIndex
 
impl Debug for HardenedIndex
Source§impl Default for HardenedIndex
 
impl Default for HardenedIndex
Source§fn default() -> HardenedIndex
 
fn default() -> HardenedIndex
Returns the “default value” for a type. Read more
Source§impl Display for HardenedIndex
 
impl Display for HardenedIndex
Source§impl From<HardenedIndex> for DerivationIndex
 
impl From<HardenedIndex> for DerivationIndex
Source§fn from(v: HardenedIndex) -> DerivationIndex
 
fn from(v: HardenedIndex) -> DerivationIndex
Converts to this type from the input type.
Source§impl From<u16> for HardenedIndex
 
impl From<u16> for HardenedIndex
Source§fn from(v: u16) -> HardenedIndex
 
fn from(v: u16) -> HardenedIndex
Converts to this type from the input type.
Source§impl From<u8> for HardenedIndex
 
impl From<u8> for HardenedIndex
Source§fn from(v: u8) -> HardenedIndex
 
fn from(v: u8) -> HardenedIndex
Converts to this type from the input type.
Source§impl FromStr for HardenedIndex
 
impl FromStr for HardenedIndex
Source§type Err = IndexParseError
 
type Err = IndexParseError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<HardenedIndex, <HardenedIndex as FromStr>::Err>
 
fn from_str(s: &str) -> Result<HardenedIndex, <HardenedIndex as FromStr>::Err>
Parses a string 
s to return a value of this type. Read moreSource§impl Hash for HardenedIndex
 
impl Hash for HardenedIndex
Source§impl Idx for HardenedIndex
 
impl Idx for HardenedIndex
Source§const ZERO: HardenedIndex
 
const ZERO: HardenedIndex
Derivation path segment with index equal to zero.
Source§const ONE: HardenedIndex
 
const ONE: HardenedIndex
Derivation path segment with index equal to one.
Source§const MAX: HardenedIndex
 
const MAX: HardenedIndex
Derivation path segment with index equal to maximum value.
Source§fn from_child_number(child_no: impl Into<u16>) -> HardenedIndex
 
fn from_child_number(child_no: impl Into<u16>) -> HardenedIndex
Constructs index from a given child number. Read more
Source§fn try_from_child_number(
    child_no: impl Into<u32>,
) -> Result<HardenedIndex, IndexError>
 
fn try_from_child_number( child_no: impl Into<u32>, ) -> Result<HardenedIndex, IndexError>
Constructs index from a given child number. Read more
Source§fn try_from_index(index: u32) -> Result<HardenedIndex, IndexError>
 
fn try_from_index(index: u32) -> Result<HardenedIndex, IndexError>
Constructs derivation path segment with specific derivation value, which
for normal indexes must lie in range 
0..HARDENED_INDEX_BOUNDARY
and for hardened in range of HARDENED_INDEX_BOUNDARY..=u32::MAXSource§fn checked_add_assign(&mut self, add: impl Into<u32>) -> Option<HardenedIndex>
 
fn checked_add_assign(&mut self, add: impl Into<u32>) -> Option<HardenedIndex>
Mutates the self by adding value the index; fails if the index value
overflow happens.
Source§fn checked_sub_assign(&mut self, sub: impl Into<u32>) -> Option<HardenedIndex>
 
fn checked_sub_assign(&mut self, sub: impl Into<u32>) -> Option<HardenedIndex>
Mutates the self by subtracting value the index; fails if the index
value overflow happens.
fn to_be_bytes(&self) -> [u8; 4]
Source§fn checked_inc(&self) -> Option<Self>
 
fn checked_inc(&self) -> Option<Self>
Increments the index on one step; fails if the index value is already
maximum value.
Source§fn checked_dec(&self) -> Option<Self>
 
fn checked_dec(&self) -> Option<Self>
Decrements the index on one step; fails if the index value is already
minimum value.
Source§fn saturating_inc(&self) -> Self
 
fn saturating_inc(&self) -> Self
Increments the index on one step saturating at the 
Self::MAX bounds
instead of overflowing.Source§fn saturating_dec(&self) -> Self
 
fn saturating_dec(&self) -> Self
Decrements the index on one step saturating at the 
Self::MIN bounds
instead of overflowing.Source§fn wrapping_inc(&self) -> Self
 
fn wrapping_inc(&self) -> Self
Increments the index on one step; fails if the index value is already
maximum value.
Source§fn wrapping_dec(&self) -> Self
 
fn wrapping_dec(&self) -> Self
Decrements the index on one step; fails if the index value is already
minimum value.
Source§fn checked_inc_assign(&mut self) -> Option<Self>
 
fn checked_inc_assign(&mut self) -> Option<Self>
Mutates the self by incrementing the index on one step; fails if the index
value is already maximum value.
Source§fn checked_dec_assign(&mut self) -> Option<Self>
 
fn checked_dec_assign(&mut self) -> Option<Self>
Mutates the self by decrementing the index on one step; fails if the index
value is already maximum value.
Source§fn saturating_inc_assign(&mut self) -> bool
 
fn saturating_inc_assign(&mut self) -> bool
Mutates the self by incrementing the index on one step, saturating at the
Self::MAX bounds instead of overflowing.Source§fn saturating_dec_assign(&mut self) -> bool
 
fn saturating_dec_assign(&mut self) -> bool
Mutates the self by decrementing the index on one step, saturating at the
Self::MIN bounds instead of overflowing.Source§fn wrapping_inc_assign(&mut self)
 
fn wrapping_inc_assign(&mut self)
Mutates the self by incrementing the index on one step; fails if the index
value is already maximum value.
Source§fn wrapping_dec_assign(&mut self)
 
fn wrapping_dec_assign(&mut self)
Mutates the self by decrementing the index on one step; fails if the index
value is already maximum value.
Source§fn checked_add(&self, add: impl Into<u32>) -> Option<Self>
 
fn checked_add(&self, add: impl Into<u32>) -> Option<Self>
Adds value the index; fails if the index value overflow happens.
Source§fn checked_sub(&self, sub: impl Into<u32>) -> Option<Self>
 
fn checked_sub(&self, sub: impl Into<u32>) -> Option<Self>
Subtracts value the index; fails if the index value overflow happens.
Source§fn saturating_add(&self, add: impl Into<u32>) -> Self
 
fn saturating_add(&self, add: impl Into<u32>) -> Self
Saturating index addition. Computes 
self + add, saturating at the
Self::MAX bounds instead of overflowing.Source§fn saturating_sub(&self, sub: impl Into<u32>) -> Self
 
fn saturating_sub(&self, sub: impl Into<u32>) -> Self
Saturating index subtraction. Computes 
self - add, saturating at
the Self::MIN bounds instead of overflowing.Source§impl IdxBase for HardenedIndex
 
impl IdxBase for HardenedIndex
Source§fn child_number(&self) -> u32
 
fn child_number(&self) -> u32
Returns hardened index number not offset by HARDENED_INDEX_BOUNDARY
(i.e. zero-based).
Source§fn index(&self) -> u32
 
fn index(&self) -> u32
Returns hardened index number offset by HARDENED_INDEX_BOUNDARY.
Source§fn is_hardened(&self) -> bool
 
fn is_hardened(&self) -> bool
Detects whether path segment uses hardened index(es)
Source§impl Ord for HardenedIndex
 
impl Ord for HardenedIndex
Source§fn cmp(&self, other: &HardenedIndex) -> Ordering
 
fn cmp(&self, other: &HardenedIndex) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<u16> for HardenedIndex
 
impl PartialEq<u16> for HardenedIndex
Source§impl PartialEq<u8> for HardenedIndex
 
impl PartialEq<u8> for HardenedIndex
Source§impl PartialEq for HardenedIndex
 
impl PartialEq for HardenedIndex
Source§impl PartialOrd<u16> for HardenedIndex
 
impl PartialOrd<u16> for HardenedIndex
Source§impl PartialOrd<u8> for HardenedIndex
 
impl PartialOrd<u8> for HardenedIndex
Source§impl PartialOrd for HardenedIndex
 
impl PartialOrd for HardenedIndex
Source§impl TryFrom<DerivationIndex> for HardenedIndex
 
impl TryFrom<DerivationIndex> for HardenedIndex
Source§type Error = IndexError
 
type Error = IndexError
The type returned in the event of a conversion error.
Source§fn try_from(
    idx: DerivationIndex,
) -> Result<HardenedIndex, <HardenedIndex as TryFrom<DerivationIndex>>::Error>
 
fn try_from( idx: DerivationIndex, ) -> Result<HardenedIndex, <HardenedIndex as TryFrom<DerivationIndex>>::Error>
Performs the conversion.
impl Copy for HardenedIndex
impl Eq for HardenedIndex
impl StructuralPartialEq for HardenedIndex
Auto Trait Implementations§
impl Freeze for HardenedIndex
impl RefUnwindSafe for HardenedIndex
impl Send for HardenedIndex
impl Sync for HardenedIndex
impl Unpin for HardenedIndex
impl UnwindSafe for HardenedIndex
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> Comparable<K> for Q
 
impl<Q, K> Comparable<K> for Q
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.