pub trait Signer {
type Validator: Validator;
type Signature: Signature;
type SignFuture: Future<Output = Self::Signature>;
// Required methods
fn validator(&self) -> Self::Validator;
fn sign(
&self,
message: impl IntoIterator<Item = impl AsRef<[u8]>>,
) -> Self::SignFuture;
}Expand description
A signer for a validator.
Required Associated Types§
Sourcetype SignFuture: Future<Output = Self::Signature>
type SignFuture: Future<Output = Self::Signature>
The future yielded by Signer::sign.
This DOES NOT need to be cancel-safe.
Required Methods§
Sourcefn validator(&self) -> Self::Validator
fn validator(&self) -> Self::Validator
This validator’s ID.
This MUST be consistent and not change across multiple invocations.
Sourcefn sign(
&self,
message: impl IntoIterator<Item = impl AsRef<[u8]>>,
) -> Self::SignFuture
fn sign( &self, message: impl IntoIterator<Item = impl AsRef<[u8]>>, ) -> Self::SignFuture
Sign a signature as this validator.
The message is the concatenation of each byte slice yielded by the iterator.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".