Skip to main content

LogSourceAsyncExt

Trait LogSourceAsyncExt 

Source
pub trait LogSourceAsyncExt: LogSourceAsync {
    // Provided methods
    fn latest_sensor<T: SensorData>(
        &mut self,
    ) -> impl Future<Output = Result<Option<(EntryHeader, T)>, Error>> { ... }
    fn oldest_sensor<T: SensorData>(
        &mut self,
    ) -> impl Future<Output = Result<Option<(EntryHeader, T)>, Error>> { ... }
    fn count_sensor<T: SensorData>(
        &mut self,
    ) -> impl Future<Output = Result<u32, Error>> { ... }
    fn query_sensor<T: SensorData, C>(
        &mut self,
        t_start: u64,
        t_end: u64,
        callback: C,
    ) -> impl Future<Output = Result<u32, Error>>
       where C: FnMut(&EntryHeader, &T) -> bool { ... }
    fn query_all_sensor<T: SensorData, C>(
        &mut self,
        callback: C,
    ) -> impl Future<Output = Result<u32, Error>>
       where C: FnMut(&EntryHeader, &T) -> bool { ... }
}
Expand description

Async mirror of LogSourceExt, with the same payload-size contract.

Provided Methods§

Source

fn latest_sensor<T: SensorData>( &mut self, ) -> impl Future<Output = Result<Option<(EntryHeader, T)>, Error>>

The most recent value for a sensor type.

Source

fn oldest_sensor<T: SensorData>( &mut self, ) -> impl Future<Output = Result<Option<(EntryHeader, T)>, Error>>

The oldest retained value for a sensor type.

Source

fn count_sensor<T: SensorData>( &mut self, ) -> impl Future<Output = Result<u32, Error>>

Entries retained for a sensor type.

Source

fn query_sensor<T: SensorData, C>( &mut self, t_start: u64, t_end: u64, callback: C, ) -> impl Future<Output = Result<u32, Error>>
where C: FnMut(&EntryHeader, &T) -> bool,

Values for a sensor type whose timestamp lies in [t_start, t_end].

Source

fn query_all_sensor<T: SensorData, C>( &mut self, callback: C, ) -> impl Future<Output = Result<u32, Error>>
where C: FnMut(&EntryHeader, &T) -> bool,

Every retained value for a sensor type, in log order.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§