Trait PublicKey

Source
pub trait PublicKey:
    Clone
    + Debug
    + Display
    + FromStr
    + Send
    + Sync
    + 'static
    + Sized {
    type SecretKey;
    type Address: Address;
    type Format: Format;

    // Required methods
    fn from_secret_key(secret_key: &Self::SecretKey) -> Self;
    fn to_address(
        &self,
        format: &Self::Format,
    ) -> Result<Self::Address, AddressError>;
}
Expand description

Generic public key.

Required Associated Types§

Required Methods§

Source

fn from_secret_key(secret_key: &Self::SecretKey) -> Self

Returns a public key given an secp256k1 secret key.

Source

fn to_address( &self, format: &Self::Format, ) -> Result<Self::Address, AddressError>

Returns an address corresponding to this public key.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§