Struct grin_keychain::ExtKeychainPath
source · pub struct ExtKeychainPath {
pub depth: u8,
pub path: [ChildNumber; 4],
}
Expand description
Encapsulates a max 4-level deep BIP32 path, which is the most we can currently fit into a rangeproof message. The depth encodes how far the derivation depths go and allows differentiating paths. As m/0, m/0/0 or m/0/0/0/0 result in different derivations, a path needs to encode its maximum depth.
Fields§
§depth: u8
§path: [ChildNumber; 4]
Implementations§
source§impl ExtKeychainPath
impl ExtKeychainPath
sourcepub fn new(depth: u8, d0: u32, d1: u32, d2: u32, d3: u32) -> ExtKeychainPath
pub fn new(depth: u8, d0: u32, d1: u32, d2: u32, d3: u32) -> ExtKeychainPath
Return a new chain path with given derivation and depth
sourcepub fn from_identifier(id: &Identifier) -> ExtKeychainPath
pub fn from_identifier(id: &Identifier) -> ExtKeychainPath
from an Indentifier [manual deserialization]
sourcepub fn to_identifier(&self) -> Identifier
pub fn to_identifier(&self) -> Identifier
to an Identifier [manual serialization]
sourcepub fn last_path_index(&self) -> u32
pub fn last_path_index(&self) -> u32
Last part of the path (for last n_child)
Trait Implementations§
source§impl Clone for ExtKeychainPath
impl Clone for ExtKeychainPath
source§fn clone(&self) -> ExtKeychainPath
fn clone(&self) -> ExtKeychainPath
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 ExtKeychainPath
impl Debug for ExtKeychainPath
source§impl<'de> Deserialize<'de> for ExtKeychainPath
impl<'de> Deserialize<'de> for ExtKeychainPath
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 ExtKeychainPath
impl PartialEq for ExtKeychainPath
source§fn eq(&self, other: &ExtKeychainPath) -> bool
fn eq(&self, other: &ExtKeychainPath) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for ExtKeychainPath
impl Eq for ExtKeychainPath
impl StructuralPartialEq for ExtKeychainPath
Auto Trait Implementations§
impl Freeze for ExtKeychainPath
impl RefUnwindSafe for ExtKeychainPath
impl Send for ExtKeychainPath
impl Sync for ExtKeychainPath
impl Unpin for ExtKeychainPath
impl UnwindSafe for ExtKeychainPath
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<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
Compare self to
key
and return true
if they are equal.