pub struct PublicKey(/* private fields */);
Expand description
This is a public key, which identifies an actor (usually a person) and is shared.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn as_hex_string(&self) -> String
pub fn as_hex_string(&self) -> String
Render into a hexadecimal string
Consider converting .into()
a PublicKeyHex
which is a wrapped type rather than a naked String
Sourcepub fn try_from_hex_string(v: &str, verify: bool) -> Result<PublicKey, Error>
pub fn try_from_hex_string(v: &str, verify: bool) -> Result<PublicKey, Error>
Create from a hexadecimal string
If verify is true, will verify that it works as a XOnlyPublicKey. This has a performance cost.
Sourcepub fn as_bech32_string(&self) -> String
pub fn as_bech32_string(&self) -> String
Export as a bech32 encoded string
Sourcepub fn as_xonly_public_key(&self) -> XOnlyPublicKey
pub fn as_xonly_public_key(&self) -> XOnlyPublicKey
Export as XOnlyPublicKey
Sourcepub fn try_from_bech32_string(s: &str, verify: bool) -> Result<PublicKey, Error>
pub fn try_from_bech32_string(s: &str, verify: bool) -> Result<PublicKey, Error>
Import from a bech32 encoded string
If verify is true, will verify that it works as a XOnlyPublicKey. This has a performance cost.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
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 From<&PublicKey> for PublicKeyHex
impl From<&PublicKey> for PublicKeyHex
Source§fn from(pk: &PublicKey) -> PublicKeyHex
fn from(pk: &PublicKey) -> PublicKeyHex
Converts to this type from the input type.
Source§impl From<PublicKey> for PublicKeyHex
impl From<PublicKey> for PublicKeyHex
Source§fn from(pk: PublicKey) -> PublicKeyHex
fn from(pk: PublicKey) -> PublicKeyHex
Converts to this type from the input type.
Source§impl Ord for PublicKey
impl Ord for PublicKey
Source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
Source§impl TryFrom<&PublicKeyHex> for PublicKey
impl TryFrom<&PublicKeyHex> for PublicKey
Source§impl TryFrom<PublicKeyHex> for PublicKey
impl TryFrom<PublicKeyHex> for PublicKey
impl Copy for PublicKey
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
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