pub trait AddressEx {
// Provided methods
fn from_pub_key<K>(key: K) -> Result<Address>
where K: TryInto<[u8; 65]>,
K::Error: Error + Send + Sync + 'static { ... }
fn from_pub_key_compressed<K>(key: K) -> Result<Address>
where K: TryInto<[u8; 33]>,
K::Error: Error + Send + Sync + 'static { ... }
fn from_any_pub_key<S>(key: S) -> Result<Address>
where S: AsRef<[u8]> { ... }
fn from_private_key(key: &[u8]) -> Result<Address> { ... }
}Expand description
Extend Address structure, add some usefull helper fns.
Provided Methods§
Sourcefn from_pub_key<K>(key: K) -> Result<Address>
fn from_pub_key<K>(key: K) -> Result<Address>
Create address from public key.
Sourcefn from_pub_key_compressed<K>(key: K) -> Result<Address>
fn from_pub_key_compressed<K>(key: K) -> Result<Address>
Create address from compressed public key.
Sourcefn from_any_pub_key<S>(key: S) -> Result<Address>
fn from_any_pub_key<S>(key: S) -> Result<Address>
Create address from AsRef<[u8]>, and auto detecting public key type.
Sourcefn from_private_key(key: &[u8]) -> Result<Address>
fn from_private_key(key: &[u8]) -> Result<Address>
Create address from private 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.