Provider

Trait Provider 

Source
pub trait Provider:
    Clone
    + Send
    + Sync
    + 'static {
    type Scope: Clone + Send + Sync + 'static;
    type Scheme: Scheme;

    // Required method
    fn scoped(&self, scope: Self::Scope) -> Option<Arc<Self::Scheme>>;

    // Provided method
    fn all(&self) -> Option<Arc<Self::Scheme>> { ... }
}
Expand description

Supplies the signing scheme for a given scope.

This trait uses an associated Scope type, allowing implementations to work with any scope representation (e.g., epoch numbers, block heights, etc.).

Required Associated Types§

Source

type Scope: Clone + Send + Sync + 'static

The scope type used to look up schemes.

Source

type Scheme: Scheme

The signing scheme to provide.

Required Methods§

Source

fn scoped(&self, scope: Self::Scope) -> Option<Arc<Self::Scheme>>

Return the signing scheme that corresponds to scope.

Provided Methods§

Source

fn all(&self) -> Option<Arc<Self::Scheme>>

Return a certificate verifier that can validate certificates from all scopes.

This method allows implementations to provide a verifier that can validate certificates from all scopes (without scope-specific state). For example, bls12381_threshold::Scheme maintains a static public key across epochs that can be used to verify certificates from any epoch, even after the committee has rotated and the underlying secret shares have been refreshed.

The default implementation returns None. Callers should fall back to Provider::scoped for scope-specific verification.

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§

Source§

impl<S: Scheme, Sc: Clone + Send + Sync + 'static> Provider for ConstantProvider<S, Sc>

Source§

type Scope = Sc

Source§

type Scheme = S