Skip to main content

Signer

Trait Signer 

Source
pub trait Signer: Send + Sync {
    type ValidatorId: ValidatorId;
    type Signature: Signature;

    // Required methods
    fn validator_id<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<Self::ValidatorId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sign<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Self::Signature> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A signer for a validator.

Required Associated Types§

Required Methods§

Source

fn validator_id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Self::ValidatorId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the validator’s current ID. Returns None if they aren’t a current validator.

Source

fn sign<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Self::Signature> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sign a signature with the current validator’s private key.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<S: Signer> Signer for Arc<S>

Source§

type ValidatorId = <S as Signer>::ValidatorId

Source§

type Signature = <S as Signer>::Signature

Source§

fn validator_id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Self::ValidatorId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn sign<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Self::Signature> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§