Skip to main content

ExtractionUnit

Trait ExtractionUnit 

Source
pub trait ExtractionUnit: Send + Sync {
    // Required methods
    fn pending<'life0, 'async_trait>(
        &'life0 self,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, GraphError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn extract<'life0, 'async_trait>(
        &'life0 self,
        log_number: u32,
    ) -> Pin<Box<dyn Future<Output = Result<UnitReport, GraphError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn quarantine<'life0, 'life1, 'async_trait>(
        &'life0 self,
        log_number: u32,
        reason: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

One archive’s worth of extraction, as the scheduler sees it.

Kept behind a trait so the worker’s scheduling — when it waits, when it yields, when it stops — can be exercised without a store or a model.

Required Methods§

Source

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

Log numbers still awaiting extraction, at most limit of them.

Source

fn extract<'life0, 'async_trait>( &'life0 self, log_number: u32, ) -> Pin<Box<dyn Future<Output = Result<UnitReport, GraphError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Extract one archive and mark it extracted. Marking is the last thing it does, so a failure or an interruption leaves the archive pending.

Source

fn quarantine<'life0, 'life1, 'async_trait>( &'life0 self, log_number: u32, reason: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stop offering this archive: it has failed [MAX_UNIT_ATTEMPTS] times.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§