[][src]Struct bitcoin_rpc_client::PrivateKey

pub struct PrivateKey {
    pub compressed: bool,
    pub network: Network,
    pub key: SecretKey,
}

A Bitcoin ECDSA private key

Fields

compressed: bool

Whether this private key should be serialized as compressed

network: Network

The network on which this key should be used

key: SecretKey

The actual ECDSA key

Methods

impl PrivateKey[src]

pub fn public_key<C>(&self, secp: &Secp256k1<C>) -> PublicKey where
    C: Signing, 
[src]

Creates a public key from this private key

pub fn to_bytes(&self) -> Vec<u8>[src]

Serialize the private key to bytes

pub fn fmt_wif(&self, fmt: &mut dyn Write) -> Result<(), Error>[src]

Format the private key to WIF format.

pub fn to_wif(&self) -> String[src]

Get WIF encoding of this private key.

pub fn from_wif(wif: &str) -> Result<PrivateKey, Error>[src]

Parse WIF encoded private key.

Trait Implementations

impl Eq for PrivateKey[src]

impl<'de> Deserialize<'de> for PrivateKey[src]

impl Clone for PrivateKey[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<PrivateKey> for PrivateKey[src]

impl Index<RangeFull> for PrivateKey[src]

type Output = [u8]

The returned type after indexing.

impl FromStr for PrivateKey[src]

type Err = Error

The associated error which can be returned from parsing.

impl Debug for PrivateKey[src]

impl Display for PrivateKey[src]

impl Copy for PrivateKey[src]

impl Serialize for PrivateKey[src]

impl From<PrivateKey> for PrivateKey[src]

impl From<PrivateKey> for PrivateKey[src]

Auto Trait Implementations

impl Send for PrivateKey

impl Sync for PrivateKey

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Configure for T where
    T: ?Sized
[src]

fn readable(self) -> Readable<Self>[src]

Marks self as using is_human_readable == true

fn compact(self) -> Compact<Self>[src]

Marks self as using is_human_readable == false

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T

impl<'a, T> TryFrom<&'a str> for T where
    T: FromStr

type Err = <T as FromStr>::Err

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err