Struct bitcoin::util::bip32::DerivationPath [−][src]
pub struct DerivationPath(_);
A BIP-32 derivation path.
Implementations
impl DerivationPath
[src]
impl DerivationPath
[src]pub fn len(&self) -> usize
[src]
Returns length of the derivation path
pub fn master() -> DerivationPath
[src]
Returns derivation path for a master key (i.e. empty derivation path)
pub fn is_master(&self) -> bool
[src]
Returns whether derivation path represents master key (i.e. it’s length
is empty). True for m
path.
pub fn child(&self, cn: ChildNumber) -> DerivationPath
[src]
Create a new DerivationPath that is a child of this one.
pub fn into_child(self, cn: ChildNumber) -> DerivationPath
[src]
Convert into a DerivationPath that is a child of this one.
pub fn children_from(&self, cn: ChildNumber) -> DerivationPathIterator<'_>ⓘNotable traits for DerivationPathIterator<'a>
impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
[src]
Notable traits for DerivationPathIterator<'a>
impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
Get an Iterator over the children of this DerivationPath starting with the given ChildNumber.
pub fn normal_children(&self) -> DerivationPathIterator<'_>ⓘNotable traits for DerivationPathIterator<'a>
impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
[src]
Notable traits for DerivationPathIterator<'a>
impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
Get an Iterator over the unhardened children of this DerivationPath.
pub fn hardened_children(&self) -> DerivationPathIterator<'_>ⓘNotable traits for DerivationPathIterator<'a>
impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
[src]
Notable traits for DerivationPathIterator<'a>
impl<'a> Iterator for DerivationPathIterator<'a> type Item = DerivationPath;
Get an Iterator over the hardened children of this DerivationPath.
pub fn extend<T: AsRef<[ChildNumber]>>(&self, path: T) -> DerivationPath
[src]
Concatenate self
with path
and return the resulting new path.
use bitcoin::util::bip32::{DerivationPath, ChildNumber}; use std::str::FromStr; let base = DerivationPath::from_str("m/42").unwrap(); let deriv_1 = base.extend(DerivationPath::from_str("m/0/1").unwrap()); let deriv_2 = base.extend(&[ ChildNumber::from_normal_idx(0).unwrap(), ChildNumber::from_normal_idx(1).unwrap() ]); assert_eq!(deriv_1, deriv_2);
Trait Implementations
impl AsRef<[ChildNumber]> for DerivationPath
[src]
impl AsRef<[ChildNumber]> for DerivationPath
[src]fn as_ref(&self) -> &[ChildNumber]
[src]
impl Clone for DerivationPath
[src]
impl Clone for DerivationPath
[src]fn clone(&self) -> DerivationPath
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for DerivationPath
[src]
impl Default for DerivationPath
[src]fn default() -> DerivationPath
[src]
impl<'de> Deserialize<'de> for DerivationPath
[src]
impl<'de> Deserialize<'de> for DerivationPath
[src]fn deserialize<D>(deserializer: D) -> Result<DerivationPath, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl<'a> From<&'a [ChildNumber]> for DerivationPath
[src]
impl<'a> From<&'a [ChildNumber]> for DerivationPath
[src]fn from(numbers: &'a [ChildNumber]) -> Self
[src]
impl From<Vec<ChildNumber, Global>> for DerivationPath
[src]
impl From<Vec<ChildNumber, Global>> for DerivationPath
[src]fn from(numbers: Vec<ChildNumber>) -> Self
[src]
impl FromIterator<ChildNumber> for DerivationPath
[src]
impl FromIterator<ChildNumber> for DerivationPath
[src]fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = ChildNumber>,
[src]
T: IntoIterator<Item = ChildNumber>,
impl FromStr for DerivationPath
[src]
impl FromStr for DerivationPath
[src]impl Hash for DerivationPath
[src]
impl Hash for DerivationPath
[src]impl Index<Range<usize>> for DerivationPath
[src]
impl Index<Range<usize>> for DerivationPath
[src]impl Index<RangeFrom<usize>> for DerivationPath
[src]
impl Index<RangeFrom<usize>> for DerivationPath
[src]impl Index<RangeFull> for DerivationPath
[src]
impl Index<RangeFull> for DerivationPath
[src]type Output = [ChildNumber]
The returned type after indexing.
fn index(&self, _: RangeFull) -> &[ChildNumber]
[src]
impl Index<RangeTo<usize>> for DerivationPath
[src]
impl Index<RangeTo<usize>> for DerivationPath
[src]impl Index<usize> for DerivationPath
[src]
impl Index<usize> for DerivationPath
[src]type Output = ChildNumber
The returned type after indexing.
fn index(&self, index: usize) -> &ChildNumber
[src]
impl Into<Vec<ChildNumber, Global>> for DerivationPath
[src]
impl Into<Vec<ChildNumber, Global>> for DerivationPath
[src]fn into(self) -> Vec<ChildNumber>
[src]
impl<'a> IntoIterator for &'a DerivationPath
[src]
impl<'a> IntoIterator for &'a DerivationPath
[src]type Item = &'a ChildNumber
The type of the elements being iterated over.
type IntoIter = Iter<'a, ChildNumber>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl Ord for DerivationPath
[src]
impl Ord for DerivationPath
[src]impl PartialEq<DerivationPath> for DerivationPath
[src]
impl PartialEq<DerivationPath> for DerivationPath
[src]fn eq(&self, other: &DerivationPath) -> bool
[src]
fn ne(&self, other: &DerivationPath) -> bool
[src]
impl PartialOrd<DerivationPath> for DerivationPath
[src]
impl PartialOrd<DerivationPath> for DerivationPath
[src]fn partial_cmp(&self, other: &DerivationPath) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'de> Serialize for DerivationPath
[src]
impl<'de> Serialize for DerivationPath
[src]impl Eq for DerivationPath
[src]
impl StructuralEq for DerivationPath
[src]
impl StructuralPartialEq for DerivationPath
[src]
Auto Trait Implementations
impl RefUnwindSafe for DerivationPath
impl Send for DerivationPath
impl Sync for DerivationPath
impl Unpin for DerivationPath
impl UnwindSafe for DerivationPath
Blanket Implementations
impl<T> IntoDerivationPath for T where
T: Into<DerivationPath>,
[src]
impl<T> IntoDerivationPath for T where
T: Into<DerivationPath>,
[src]pub fn into_derivation_path(Self) -> Result<DerivationPath, Error>
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,