Enum ed25519_dalek_bip32::ChildIndex
source · pub enum ChildIndex {
Normal(u32),
Hardened(u32),
}
Expand description
An index in a DerivationPath
Variants§
Implementations§
source§impl ChildIndex
impl ChildIndex
sourcepub fn hardened(num: u32) -> Result<ChildIndex, ChildIndexError>
pub fn hardened(num: u32) -> Result<ChildIndex, ChildIndexError>
Create a ChildIndex::Hardened instance from a u32. This will fail if num
is not
in [0, 2^31 - 1]
sourcepub fn normal(num: u32) -> Result<ChildIndex, ChildIndexError>
pub fn normal(num: u32) -> Result<ChildIndex, ChildIndexError>
Create a ChildIndex::Normal instance from a u32. This will fail if num
is not
in [0, 2^31 - 1]
sourcepub fn to_u32(self) -> u32
pub fn to_u32(self) -> u32
Convert ChildIndex to its inner u32
sourcepub fn to_bits(self) -> u32
pub fn to_bits(self) -> u32
Convert ChildIndex to a u32 representing the type and a 31 bit number. The highest bit is set for a hard derivation and clear for a normal derivation, and the remaining 31 bits are the index
sourcepub fn from_bits(bits: u32) -> ChildIndex
pub fn from_bits(bits: u32) -> ChildIndex
Build a ChildIndex from a u32 representing the type and a 31 bit number. See ChildIndex::to_bits for more information
sourcepub fn is_hardened(self) -> bool
pub fn is_hardened(self) -> bool
Check if the ChildIndex is “hardened”
sourcepub fn is_normal(self) -> bool
pub fn is_normal(self) -> bool
Check if the ChildIndex is “normal”
Trait Implementations§
source§impl Clone for ChildIndex
impl Clone for ChildIndex
source§fn clone(&self) -> ChildIndex
fn clone(&self) -> ChildIndex
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 ChildIndex
impl Debug for ChildIndex
source§impl Display for ChildIndex
impl Display for ChildIndex
source§impl FromStr for ChildIndex
impl FromStr for ChildIndex
§type Err = ChildIndexParseError
type Err = ChildIndexParseError
The associated error which can be returned from parsing.
source§fn from_str(s: &str) -> Result<ChildIndex, <ChildIndex as FromStr>::Err>
fn from_str(s: &str) -> Result<ChildIndex, <ChildIndex as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moresource§impl Ord for ChildIndex
impl Ord for ChildIndex
source§fn cmp(&self, other: &ChildIndex) -> Ordering
fn cmp(&self, other: &ChildIndex) -> 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<ChildIndex> for ChildIndex
impl PartialEq<ChildIndex> for ChildIndex
source§fn eq(&self, other: &ChildIndex) -> bool
fn eq(&self, other: &ChildIndex) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ChildIndex> for ChildIndex
impl PartialOrd<ChildIndex> for ChildIndex
source§fn partial_cmp(&self, other: &ChildIndex) -> Option<Ordering>
fn partial_cmp(&self, other: &ChildIndex) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for ChildIndex
impl Eq for ChildIndex
impl StructuralEq for ChildIndex
impl StructuralPartialEq for ChildIndex
Auto Trait Implementations§
impl RefUnwindSafe for ChildIndex
impl Send for ChildIndex
impl Sync for ChildIndex
impl Unpin for ChildIndex
impl UnwindSafe for ChildIndex
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