Struct coins_bip32::path::KeyDerivation
source · pub struct KeyDerivation {
pub root: KeyFingerprint,
pub path: DerivationPath,
}
Expand description
A Derivation Path for a bip32 key
Fields§
§root: KeyFingerprint
The root key fingerprint
path: DerivationPath
The derivation path from the root key
Implementations§
source§impl KeyDerivation
impl KeyDerivation
sourcepub fn same_root(&self, other: &Self) -> bool
pub fn same_root(&self, other: &Self) -> bool
true
if the keys share a root fingerprint, false
otherwise. Note that on key
fingerprints, which may collide accidentally, or be intentionally collided.
sourcepub fn is_possible_ancestor_of(&self, other: &Self) -> bool
pub fn is_possible_ancestor_of(&self, other: &Self) -> bool
true
if this key is an ancestor of other, false
otherwise. Note that on key
fingerprints, which may collide accidentally, or be intentionally collided.
sourcepub fn path_to_descendant(&self, descendant: &Self) -> Option<DerivationPath>
pub fn path_to_descendant(&self, descendant: &Self) -> Option<DerivationPath>
Returns the path to the decendant.
Trait Implementations§
source§impl ByteFormat for KeyDerivation
impl ByteFormat for KeyDerivation
§type Error = Bip32Error
type Error = Bip32Error
An associated error type
source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the byte-length of the serialized data structure.
source§fn read_from<T>(_reader: &mut T) -> Result<Self, Self::Error>
fn read_from<T>(_reader: &mut T) -> Result<Self, Self::Error>
Deserializes an instance of
Self
from a std::io::Read
.
The limit
argument is used only when deserializing collections, and specifies a maximum
number of instances of the underlying type to read. Read moresource§fn write_to<T>(&self, writer: &mut T) -> Result<usize, Self::Error>where
T: Write,
fn write_to<T>(&self, writer: &mut T) -> Result<usize, Self::Error>where
T: Write,
Serializes
self
to a std::io::Write
. Following Write
trait conventions, its Ok
type must be a usize
denoting the number of bytes written. Read moresource§fn read_seq_from<R>(
reader: &mut R,
mode: ReadSeqMode,
) -> Result<Vec<Self>, Self::Error>
fn read_seq_from<R>( reader: &mut R, mode: ReadSeqMode, ) -> Result<Vec<Self>, Self::Error>
Read a sequence of objects from the reader. The mode argument specifies
how many objects to read.
source§fn write_seq_to<'a, W, E, Iter, Item>(
writer: &mut W,
iter: Iter,
) -> Result<usize, Self::Error>
fn write_seq_to<'a, W, E, Iter, Item>( writer: &mut W, iter: Iter, ) -> Result<usize, Self::Error>
Write a sequence of
ByteFormat
objects to a writer. The iter
argument may be any object that implements
IntoIterator<Item = &Item>
. This means we can seamlessly use vectors,
slices, etc. Read moresource§fn deserialize_hex(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
fn deserialize_hex(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
Decodes a hex string to a
Vec<u8>
, deserializes an instance of Self
from that vector.source§fn deserialize_base64(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
fn deserialize_base64(s: &str) -> Result<Self, Self::Error>where
Self: Sized,
Serialize
self
to a base64 string, using standard RFC4648 non-url safe characterssource§fn serialize_hex(&self) -> String
fn serialize_hex(&self) -> String
Serializes
self
to a vector, returns the hex-encoded vectorsource§fn serialize_base64(&self) -> String
fn serialize_base64(&self) -> String
Serialize
self
to a base64 string, using standard RFC4648 non-url safe characterssource§impl Clone for KeyDerivation
impl Clone for KeyDerivation
source§fn clone(&self) -> KeyDerivation
fn clone(&self) -> KeyDerivation
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 KeyDerivation
impl Debug for KeyDerivation
source§impl<'de> Deserialize<'de> for KeyDerivation
impl<'de> Deserialize<'de> for KeyDerivation
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for KeyDerivation
impl PartialEq for KeyDerivation
source§fn eq(&self, other: &KeyDerivation) -> bool
fn eq(&self, other: &KeyDerivation) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for KeyDerivation
impl Serialize for KeyDerivation
impl Eq for KeyDerivation
impl StructuralPartialEq for KeyDerivation
Auto Trait Implementations§
impl Freeze for KeyDerivation
impl RefUnwindSafe for KeyDerivation
impl Send for KeyDerivation
impl Sync for KeyDerivation
impl Unpin for KeyDerivation
impl UnwindSafe for KeyDerivation
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)