Skip to main content

Handler

Trait Handler 

Source
pub trait Handler: Send + Sync {
    // Required methods
    fn initialize(
        &self,
    ) -> impl Future<Output = Result<InitializeResult, ErrorCode>> + Send;
    fn sign(
        &self,
        params: SignParams,
    ) -> impl Future<Output = Result<SignResult, ErrorCode>> + Send;
}
Expand description

Trait for implementing a key provider.

Implement this trait and pass it to run to start the provider event loop. See trustless-provider-filesystem for a complete example.

Required Methods§

Source

fn initialize( &self, ) -> impl Future<Output = Result<InitializeResult, ErrorCode>> + Send

Handle an initialize request. Return all available certificates.

Source

fn sign( &self, params: SignParams, ) -> impl Future<Output = Result<SignResult, ErrorCode>> + Send

Handle a sign request. Sign the blob using the specified certificate and scheme.

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§