Skip to main content

RecordBook

Trait RecordBook 

Source
pub trait RecordBook: Send + Sync {
    // Required methods
    fn recent<'life0, 'async_trait>(
        &'life0 self,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<RecordLine>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<RecordCheck>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

What the host of the kernel’s audit log gives the control plane to read and check it (spec 3.3 §10 K5).

§Example

use adk_kernel::control::{RecordBook, RecordCheck, RecordLine};

struct Empty;

#[async_trait::async_trait]
impl RecordBook for Empty {
    async fn recent(&self, _limit: usize) -> adk_kernel::Result<Vec<RecordLine>> { Ok(vec![]) }
    async fn check(&self) -> adk_kernel::Result<RecordCheck> { Ok(RecordCheck::new(true, 0, chrono::Utc::now())) }
}

Required Methods§

Source

fn recent<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<RecordLine>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The latest limit actions, newest first.

§Errors

The log store’s error.

Source

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

Verifies the whole log against its signed checkpoints.

§Errors

The log store’s error; a log that does not verify is a RecordCheck with valid unset, not an error.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§