Enum ed25519_dalek_bip32::ChildIndex
source · [−]Expand description
An index in a DerivationPath
Variants
Normal(u32)
Hardened(u32)
Implementations
sourceimpl 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
sourceimpl Clone for ChildIndex
impl Clone for ChildIndex
sourcepub fn clone(&self) -> ChildIndex
pub fn clone(&self) -> ChildIndex
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ChildIndex
impl Debug for ChildIndex
sourceimpl Display for ChildIndex
impl Display for ChildIndex
sourceimpl FromStr for ChildIndex
impl FromStr for ChildIndex
type Err = ChildIndexParseError
type Err = ChildIndexParseError
The associated error which can be returned from parsing.
sourcepub fn from_str(s: &str) -> Result<ChildIndex, <ChildIndex as FromStr>::Err>
pub fn from_str(s: &str) -> Result<ChildIndex, <ChildIndex as FromStr>::Err>
Parses a string s
to return a value of this type. Read more
sourceimpl Ord for ChildIndex
impl Ord for ChildIndex
sourceimpl PartialEq<ChildIndex> for ChildIndex
impl PartialEq<ChildIndex> for ChildIndex
sourcepub fn eq(&self, other: &ChildIndex) -> bool
pub fn eq(&self, other: &ChildIndex) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &ChildIndex) -> bool
pub fn ne(&self, other: &ChildIndex) -> bool
This method tests for !=
.
sourceimpl PartialOrd<ChildIndex> for ChildIndex
impl PartialOrd<ChildIndex> for ChildIndex
sourcepub fn partial_cmp(&self, other: &ChildIndex) -> Option<Ordering>
pub fn partial_cmp(&self, other: &ChildIndex) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more