pub struct NormalIndex(/* private fields */);Expand description
Index for unhardened children derivation; ensures that the inner value is always < 2^31
Implementations§
Source§impl NormalIndex
 
impl NormalIndex
pub const fn normal(child_number: u16) -> NormalIndex
Trait Implementations§
Source§impl Clone for NormalIndex
 
impl Clone for NormalIndex
Source§fn clone(&self) -> NormalIndex
 
fn clone(&self) -> NormalIndex
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 NormalIndex
 
impl Debug for NormalIndex
Source§impl Default for NormalIndex
 
impl Default for NormalIndex
Source§fn default() -> NormalIndex
 
fn default() -> NormalIndex
Returns the “default value” for a type. Read more
Source§impl Display for NormalIndex
 
impl Display for NormalIndex
Source§impl From<&NormalIndex> for NormalIndex
 
impl From<&NormalIndex> for NormalIndex
Source§fn from(index: &NormalIndex) -> NormalIndex
 
fn from(index: &NormalIndex) -> NormalIndex
Converts to this type from the input type.
Source§impl From<Keychain> for NormalIndex
 
impl From<Keychain> for NormalIndex
Source§fn from(keychain: Keychain) -> NormalIndex
 
fn from(keychain: Keychain) -> NormalIndex
Converts to this type from the input type.
Source§impl From<NormalIndex> for DerivationIndex
 
impl From<NormalIndex> for DerivationIndex
Source§fn from(v: NormalIndex) -> DerivationIndex
 
fn from(v: NormalIndex) -> DerivationIndex
Converts to this type from the input type.
Source§impl From<u16> for NormalIndex
 
impl From<u16> for NormalIndex
Source§fn from(v: u16) -> NormalIndex
 
fn from(v: u16) -> NormalIndex
Converts to this type from the input type.
Source§impl From<u8> for NormalIndex
 
impl From<u8> for NormalIndex
Source§fn from(v: u8) -> NormalIndex
 
fn from(v: u8) -> NormalIndex
Converts to this type from the input type.
Source§impl FromStr for NormalIndex
 
impl FromStr for NormalIndex
Source§type Err = IndexParseError
 
type Err = IndexParseError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<NormalIndex, <NormalIndex as FromStr>::Err>
 
fn from_str(s: &str) -> Result<NormalIndex, <NormalIndex as FromStr>::Err>
Parses a string 
s to return a value of this type. Read moreSource§impl Hash for NormalIndex
 
impl Hash for NormalIndex
Source§impl Idx for NormalIndex
 
impl Idx for NormalIndex
Source§const ZERO: NormalIndex
 
const ZERO: NormalIndex
Derivation path segment with index equal to zero.
Source§const ONE: NormalIndex
 
const ONE: NormalIndex
Derivation path segment with index equal to one.
Source§const MAX: NormalIndex
 
const MAX: NormalIndex
Derivation path segment with index equal to maximum value.
Source§fn from_child_number(child_no: impl Into<u16>) -> NormalIndex
 
fn from_child_number(child_no: impl Into<u16>) -> NormalIndex
Constructs index from a given child number. Read more
Source§fn try_from_child_number(
    child_no: impl Into<u32>,
) -> Result<NormalIndex, IndexError>
 
fn try_from_child_number( child_no: impl Into<u32>, ) -> Result<NormalIndex, IndexError>
Constructs index from a given child number. Read more
Source§fn try_from_index(index: u32) -> Result<NormalIndex, IndexError>
 
fn try_from_index(index: u32) -> Result<NormalIndex, 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<NormalIndex>
 
fn checked_add_assign(&mut self, add: impl Into<u32>) -> Option<NormalIndex>
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<NormalIndex>
 
fn checked_sub_assign(&mut self, sub: impl Into<u32>) -> Option<NormalIndex>
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 NormalIndex
 
impl IdxBase for NormalIndex
Source§fn child_number(&self) -> u32
 
fn child_number(&self) -> u32
Returns unhardened index number.
Source§fn index(&self) -> u32
 
fn index(&self) -> u32
Returns value used during derivation, which for normal indexes must lie
in range 
0..HARDENED_INDEX_BOUNDARY and for hardened in range
of HARDENED_INDEX_BOUNDARY..=u32::MAXSource§fn is_hardened(&self) -> bool
 
fn is_hardened(&self) -> bool
Detects whether path segment uses hardened index(es)
Source§impl Ord for NormalIndex
 
impl Ord for NormalIndex
Source§fn cmp(&self, other: &NormalIndex) -> Ordering
 
fn cmp(&self, other: &NormalIndex) -> 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 NormalIndex
 
impl PartialEq<u16> for NormalIndex
Source§impl PartialEq<u8> for NormalIndex
 
impl PartialEq<u8> for NormalIndex
Source§impl PartialEq for NormalIndex
 
impl PartialEq for NormalIndex
Source§impl PartialOrd<u16> for NormalIndex
 
impl PartialOrd<u16> for NormalIndex
Source§impl PartialOrd<u8> for NormalIndex
 
impl PartialOrd<u8> for NormalIndex
Source§impl PartialOrd for NormalIndex
 
impl PartialOrd for NormalIndex
Source§impl TryFrom<DerivationIndex> for NormalIndex
 
impl TryFrom<DerivationIndex> for NormalIndex
Source§type Error = IndexError
 
type Error = IndexError
The type returned in the event of a conversion error.
Source§fn try_from(
    idx: DerivationIndex,
) -> Result<NormalIndex, <NormalIndex as TryFrom<DerivationIndex>>::Error>
 
fn try_from( idx: DerivationIndex, ) -> Result<NormalIndex, <NormalIndex as TryFrom<DerivationIndex>>::Error>
Performs the conversion.
impl Copy for NormalIndex
impl Eq for NormalIndex
impl StructuralPartialEq for NormalIndex
Auto Trait Implementations§
impl Freeze for NormalIndex
impl RefUnwindSafe for NormalIndex
impl Send for NormalIndex
impl Sync for NormalIndex
impl Unpin for NormalIndex
impl UnwindSafe for NormalIndex
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.