Skip to main content

StepUpProofStore

Trait StepUpProofStore 

Source
pub trait StepUpProofStore:
    Send
    + Sync
    + 'static {
    // Required method
    fn consume<'life0, 'life1, 'async_trait>(
        &'life0 self,
        proof: &'life1 StepUpVerification,
    ) -> Pin<Box<dyn Future<Output = Result<bool, BaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

step-up proof 的一次性消费存储。

实现必须以 proof ID 为键执行原子“首次写入成功”语义,并至少保留到 proof 过期。返回 false 表示该 proof 已被消费。

Required Methods§

Source

fn consume<'life0, 'life1, 'async_trait>( &'life0 self, proof: &'life1 StepUpVerification, ) -> Pin<Box<dyn Future<Output = Result<bool, BaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

尝试消费一个已完成签名与绑定校验的 proof。

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T> StepUpProofStore for Arc<T>
where T: StepUpProofStore + ?Sized,

让调用方已持有的 Arc<dyn StepUpProofStore> 也能作为 proof 存储直接传入。

Source§

fn consume<'life0, 'life1, 'async_trait>( &'life0 self, proof: &'life1 StepUpVerification, ) -> Pin<Box<dyn Future<Output = Result<bool, BaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§