pub struct PrivateKey {
pub compressed: bool,
pub network: Network,
pub key: SecretKey,
}Expand description
A Bitcoin ECDSA private key
Fields§
§compressed: boolWhether this private key should be serialized as compressed
network: NetworkThe network on which this key should be used
key: SecretKeyThe actual ECDSA key
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn public_key(&self, secp: &Secp256k1) -> PublicKey
pub fn public_key(&self, secp: &Secp256k1) -> PublicKey
Creates a public key from this private key
Trait Implementations§
Source§impl Clone for PrivateKey
impl Clone for PrivateKey
Source§fn clone(&self) -> PrivateKey
fn clone(&self) -> PrivateKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PrivateKey
impl Debug for PrivateKey
Source§impl Display for PrivateKey
impl Display for PrivateKey
Source§impl FromStr for PrivateKey
impl FromStr for PrivateKey
Source§impl Index<RangeFull> for PrivateKey
impl Index<RangeFull> for PrivateKey
Source§impl PartialEq for PrivateKey
impl PartialEq for PrivateKey
Source§fn eq(&self, other: &PrivateKey) -> bool
fn eq(&self, other: &PrivateKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PrivateKey
impl StructuralPartialEq for PrivateKey
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnsafeUnpin for PrivateKey
impl UnwindSafe for PrivateKey
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