Enum sp_core::crypto::DeriveJunction
source · pub enum DeriveJunction {
Soft([u8; 32]),
Hard([u8; 32]),
}
Expand description
A since derivation junction description. It is the single parameter used when creating
a new secret key from an existing secret key and, in the case of SoftRaw
and SoftIndex
a new public key from an existing public key.
Variants§
Soft([u8; 32])
Soft (vanilla) derivation. Public keys have a correspondent derivation.
Hard([u8; 32])
Hard (“hardened”) derivation. Public keys do not have a correspondent derivation.
Implementations§
source§impl DeriveJunction
impl DeriveJunction
sourcepub fn soften(self) -> Self
pub fn soften(self) -> Self
Consume self to return a soft derive junction with the same chain code.
sourcepub fn harden(self) -> Self
pub fn harden(self) -> Self
Consume self to return a hard derive junction with the same chain code.
sourcepub fn soft<T: Encode>(index: T) -> Self
pub fn soft<T: Encode>(index: T) -> Self
Create a new soft (vanilla) DeriveJunction from a given, encodable, value.
If you need a hard junction, use hard()
.
sourcepub fn hard<T: Encode>(index: T) -> Self
pub fn hard<T: Encode>(index: T) -> Self
Create a new hard (hardened) DeriveJunction from a given, encodable, value.
If you need a soft junction, use soft()
.
sourcepub fn unwrap_inner(self) -> [u8; 32]
pub fn unwrap_inner(self) -> [u8; 32]
Consume self to return the chain code.
Trait Implementations§
source§impl Clone for DeriveJunction
impl Clone for DeriveJunction
source§fn clone(&self) -> DeriveJunction
fn clone(&self) -> DeriveJunction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DeriveJunction
impl Debug for DeriveJunction
source§impl Decode for DeriveJunction
impl Decode for DeriveJunction
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
source§impl Encode for DeriveJunction
impl Encode for DeriveJunction
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<T: AsRef<str>> From<T> for DeriveJunction
impl<T: AsRef<str>> From<T> for DeriveJunction
source§fn from(j: T) -> DeriveJunction
fn from(j: T) -> DeriveJunction
source§impl Hash for DeriveJunction
impl Hash for DeriveJunction
source§impl PartialEq for DeriveJunction
impl PartialEq for DeriveJunction
source§fn eq(&self, other: &DeriveJunction) -> bool
fn eq(&self, other: &DeriveJunction) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for DeriveJunction
impl EncodeLike for DeriveJunction
impl Eq for DeriveJunction
impl StructuralPartialEq for DeriveJunction
Auto Trait Implementations§
impl Freeze for DeriveJunction
impl RefUnwindSafe for DeriveJunction
impl Send for DeriveJunction
impl Sync for DeriveJunction
impl Unpin for DeriveJunction
impl UnwindSafe for DeriveJunction
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
source§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.