[−][src]Struct slip132::KeyVersion
Structure holding 4 version bytes with magical numbers representing
different versions of extended public and private keys according to BIP-32.
Key version stores raw bytes without their check, interpretation or
verification; for these purposes special helpers structures implementing
VersionResolver
are used.
Implementations
impl KeyVersion
[src]
pub fn is_pub<R: VersionResolver>(&self) -> Option<bool>
[src]
Detects whether provided version corresponds to an extended public key.
Returns None
if the version is not recognized/unknown to the resolver.
pub fn is_prv<R: VersionResolver>(&self) -> Option<bool>
[src]
Detects whether provided version corresponds to an extended private key.
Returns None
if the version is not recognized/unknown to the resolver.
pub fn network<R: VersionResolver>(&self) -> Option<R::Network>
[src]
Detects network used by the provided key version bytes.
Returns None
if the version is not recognized/unknown to the resolver.
pub fn application<R: VersionResolver>(&self) -> Option<R::Application>
[src]
Detects application scope defined by the provided key version bytes.
Application scope is a types of scriptPubkey descriptors in which given
extended public/private keys can be used.
Returns None
if the version is not recognized/unknown to the resolver.
pub fn derivation_path<R: VersionResolver>(&self) -> Option<DerivationPath>
[src]
Returns BIP 32 derivation path for the provided key version.
Returns None
if the version is not recognized/unknown to the resolver.
pub fn try_to_pub<R: VersionResolver>(&self) -> Option<KeyVersion>
[src]
Converts version into version corresponding to an extended public key.
Returns None
if the resolver does not know how to perform conversion.
pub fn try_to_prv<R: VersionResolver>(&self) -> Option<KeyVersion>
[src]
Converts version into version corresponding to an extended private key.
Returns None
if the resolver does not know how to perform conversion.
impl KeyVersion
[src]
pub fn from_slice(version_slice: &[u8]) -> Option<KeyVersion>
[src]
Tries to construct KeyVersion
object from a byte slice. If byte
slice length is not equal to 4, returns None
pub fn from_bytes(version_bytes: [u8; 4]) -> KeyVersion
[src]
Constructs KeyVersion
from a fixed 4 bytes values
pub fn from_u32(version: u32) -> KeyVersion
[src]
Constructs KeyVersion
from a u32
-representation of the version
bytes (the representation must be in bing endian format)
pub fn to_u32(&self) -> u32
[src]
Converts version bytes into u32
representation in big endian format
pub fn as_slice(&self) -> &[u8]
[src]
Returns slice representing internal version bytes
pub fn as_bytes(&self) -> &[u8; 4]
[src]
Returns internal representation of version bytes
pub fn to_bytes(&self) -> [u8; 4]
[src]
Constructs 4-byte array containing version byte values
pub fn into_bytes(self) -> [u8; 4]
[src]
Converts into 4-byte array containing version byte values
Trait Implementations
impl Clone for KeyVersion
[src]
pub fn clone(&self) -> KeyVersion
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for KeyVersion
[src]
impl Debug for KeyVersion
[src]
impl Eq for KeyVersion
[src]
impl Hash for KeyVersion
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for KeyVersion
[src]
pub fn cmp(&self, other: &KeyVersion) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<KeyVersion> for KeyVersion
[src]
pub fn eq(&self, other: &KeyVersion) -> bool
[src]
pub fn ne(&self, other: &KeyVersion) -> bool
[src]
impl PartialOrd<KeyVersion> for KeyVersion
[src]
pub fn partial_cmp(&self, other: &KeyVersion) -> Option<Ordering>
[src]
pub fn lt(&self, other: &KeyVersion) -> bool
[src]
pub fn le(&self, other: &KeyVersion) -> bool
[src]
pub fn gt(&self, other: &KeyVersion) -> bool
[src]
pub fn ge(&self, other: &KeyVersion) -> bool
[src]
impl StructuralEq for KeyVersion
[src]
impl StructuralPartialEq for KeyVersion
[src]
Auto Trait Implementations
impl RefUnwindSafe for KeyVersion
[src]
impl Send for KeyVersion
[src]
impl Sync for KeyVersion
[src]
impl Unpin for KeyVersion
[src]
impl UnwindSafe for KeyVersion
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,