Trait Signer

Source
pub trait Signer: Send {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn sign(
        &self,
        owner: &AccountOwner,
        value: &CryptoHash,
    ) -> impl Future<Output = Result<AccountSignature, Self::Error>> + Send;
    fn get_public_key(
        &self,
        owner: &AccountOwner,
    ) -> impl Future<Output = Result<AccountPublicKey, Self::Error>> + Send;
    fn contains_key(
        &self,
        owner: &AccountOwner,
    ) -> impl Future<Output = Result<bool, Self::Error>> + Send;
}
Expand description

A trait for signing keys.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The type of errors arising from operations on this Signer.

Required Methods§

Source

fn sign( &self, owner: &AccountOwner, value: &CryptoHash, ) -> impl Future<Output = Result<AccountSignature, Self::Error>> + Send

Creates a signature for the given value using the provided owner.

Source

fn get_public_key( &self, owner: &AccountOwner, ) -> impl Future<Output = Result<AccountPublicKey, Self::Error>> + Send

Returns the public key corresponding to the given owner.

Source

fn contains_key( &self, owner: &AccountOwner, ) -> impl Future<Output = Result<bool, Self::Error>> + Send

Returns whether the given owner is a known signer.

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§