pub struct NonHardenedChildIndex(/* private fields */);
Expand description
A non-hardened index used in hierarchical deterministic wallet derivation paths.
Non-hardened indices allow public key derivation, enabling watch-only wallets to generate new addresses without having access to private keys. In BIP-44/ZIP-32 paths, the last two components (change and address_index) are typically non-hardened.
§Zcash Concept Relation
In Zcash HD wallet implementations:
- Hardened indices are shown with an apostrophe (e.g.,
44'
) - Non-hardened indices are shown without an apostrophe (e.g.,
0
for external)
Non-hardened indices must be below 2^31 (0x80000000).
§Examples
// Create from a u32 value
let index = NonHardenedChildIndex::from(42u32);
// Convert back to u32 when needed
let value: u32 = index.into();
assert_eq!(value, 42);
Trait Implementations§
Source§impl Clone for NonHardenedChildIndex
impl Clone for NonHardenedChildIndex
Source§fn clone(&self) -> NonHardenedChildIndex
fn clone(&self) -> NonHardenedChildIndex
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 NonHardenedChildIndex
impl Debug for NonHardenedChildIndex
Source§impl From<&NonHardenedChildIndex> for CBOR
impl From<&NonHardenedChildIndex> for CBOR
Source§fn from(value: &NonHardenedChildIndex) -> Self
fn from(value: &NonHardenedChildIndex) -> Self
Converts to this type from the input type.
Source§impl From<NonHardenedChildIndex> for CBOR
impl From<NonHardenedChildIndex> for CBOR
Source§fn from(value: NonHardenedChildIndex) -> Self
fn from(value: NonHardenedChildIndex) -> Self
Converts to this type from the input type.
Source§impl From<NonHardenedChildIndex> for Envelope
impl From<NonHardenedChildIndex> for Envelope
Source§fn from(value: NonHardenedChildIndex) -> Self
fn from(value: NonHardenedChildIndex) -> Self
Converts to this type from the input type.
Source§impl From<NonHardenedChildIndex> for u32
Extracts the u32 value from a NonHardenedChildIndex
impl From<NonHardenedChildIndex> for u32
Extracts the u32 value from a NonHardenedChildIndex
Source§fn from(value: NonHardenedChildIndex) -> Self
fn from(value: NonHardenedChildIndex) -> Self
Converts to this type from the input type.
Source§impl From<u32> for NonHardenedChildIndex
Converts a u32 value to a NonHardenedChildIndex
impl From<u32> for NonHardenedChildIndex
Converts a u32 value to a NonHardenedChildIndex
Source§impl From<usize> for NonHardenedChildIndex
Creates a NonHardenedChildIndex from a usize value (useful for array indexing)
impl From<usize> for NonHardenedChildIndex
Creates a NonHardenedChildIndex from a usize value (useful for array indexing)
Source§impl PartialEq for NonHardenedChildIndex
impl PartialEq for NonHardenedChildIndex
Source§impl TryFrom<CBOR> for NonHardenedChildIndex
impl TryFrom<CBOR> for NonHardenedChildIndex
Source§impl TryFrom<Envelope> for NonHardenedChildIndex
impl TryFrom<Envelope> for NonHardenedChildIndex
impl Copy for NonHardenedChildIndex
impl Eq for NonHardenedChildIndex
impl StructuralPartialEq for NonHardenedChildIndex
Auto Trait Implementations§
impl Freeze for NonHardenedChildIndex
impl RefUnwindSafe for NonHardenedChildIndex
impl Send for NonHardenedChildIndex
impl Sync for NonHardenedChildIndex
impl Unpin for NonHardenedChildIndex
impl UnwindSafe for NonHardenedChildIndex
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> CBORDecodable for T
impl<T> CBORDecodable for T
Source§impl<T> CBOREncodable for T
impl<T> CBOREncodable for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EnvelopeEncodable for T
impl<T> EnvelopeEncodable for T
Source§fn into_envelope(self) -> Envelope
fn into_envelope(self) -> Envelope
Converts the value into an envelope by using its Into<Envelope>
implementation.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more