Skip to main content

AnswerLog

Trait AnswerLog 

Source
pub trait AnswerLog: Send + Sync {
    // Required methods
    fn record<'life0, 'life1, 'async_trait>(
        &'life0 self,
        record: &'life1 AnswerRecord,
    ) -> Pin<Box<dyn Future<Output = Result<(), SurfaceError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn find<'life0, 'life1, 'async_trait>(
        &'life0 self,
        approval_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AnswerRecord>, SurfaceError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;

    // Provided methods
    fn since<'life0, 'async_trait>(
        &'life0 self,
        at: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<AnswerRecord>, SurfaceError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait { ... }
    fn find_for<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 ApprovalRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AnswerRecord>, SurfaceError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait { ... }
}
Available on crate feature surface only.
Expand description

Where the engine keeps how each answer was given (spec 3.3 §11).

Required Methods§

Source

fn record<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 AnswerRecord, ) -> Pin<Box<dyn Future<Output = Result<(), SurfaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Records the answer that decided record.approval_id.

Source

fn find<'life0, 'life1, 'async_trait>( &'life0 self, approval_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AnswerRecord>, SurfaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

The answer that decided approval_id, when it was given through a surface.

Provided Methods§

Source

fn since<'life0, 'async_trait>( &'life0 self, at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<AnswerRecord>, SurfaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

The answers given through a surface since at, oldest first: what “How you answered” counts (spec 3.3 §5.1). The default lists none.

Source

fn find_for<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 ApprovalRequest, ) -> Pin<Box<dyn Future<Output = Result<Option<AnswerRecord>, SurfaceError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

The answer that decided request, when it was given through a surface: what the engine reads for a decided card. A log may use the request’s times to read less; the default calls find.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§