pub struct PrivateKey {
pub key_type: KeyType,
/* private fields */
}Fields§
§key_type: KeyTypeImplementations§
Source§impl PrivateKey
impl PrivateKey
pub fn as_string(&self) -> String
pub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_hex(&self) -> String
pub fn to_wif(&self) -> Result<String, String>
pub fn to_public(&self) -> PublicKey
pub fn from_bytes(bytes: Vec<u8>, key_type: KeyType) -> Self
pub fn from_str(key: &str, ignore_checksum: bool) -> Result<Self, String>
pub fn sign_message(&self, message: &Vec<u8>) -> Signature
pub fn random(key_type: KeyType) -> Result<Self, String>
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 · 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 Default for PrivateKey
impl Default for PrivateKey
Source§fn default() -> PrivateKey
fn default() -> PrivateKey
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PrivateKey
impl<'de> Deserialize<'de> for PrivateKey
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 Display for PrivateKey
impl Display 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 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