fedimint_client::db::event_log

Trait DBTransactionEventLogExt

source
pub trait DBTransactionEventLogExt {
    // Required methods
    fn log_event_raw<'life0, 'async_trait>(
        &'life0 mut self,
        log_ordering_wakeup_tx: Sender<()>,
        kind: EventKind,
        module_kind: Option<ModuleKind>,
        module_id: Option<ModuleInstanceId>,
        payload: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_next_event_log_id<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = EventLogId> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_event_log<'life0, 'async_trait>(
        &'life0 mut self,
        pos: Option<EventLogId>,
        limit: u64,
    ) -> Pin<Box<dyn Future<Output = Vec<(EventLogId, EventKind, Option<(ModuleKind, ModuleInstanceId)>, u64, Value)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn log_event<'life0, 'async_trait, E>(
        &'life0 mut self,
        log_ordering_wakeup_tx: Sender<()>,
        module_id: Option<ModuleInstanceId>,
        event: E,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where E: Event + Send + 'async_trait,
             Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

source

fn log_event_raw<'life0, 'async_trait>( &'life0 mut self, log_ordering_wakeup_tx: Sender<()>, kind: EventKind, module_kind: Option<ModuleKind>, module_id: Option<ModuleInstanceId>, payload: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn get_next_event_log_id<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = EventLogId> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Next EventLogId to use for new ordered events.

Used by ordering task, though might be useful to get the current count of events.

source

fn get_event_log<'life0, 'async_trait>( &'life0 mut self, pos: Option<EventLogId>, limit: u64, ) -> Pin<Box<dyn Future<Output = Vec<(EventLogId, EventKind, Option<(ModuleKind, ModuleInstanceId)>, u64, Value)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read a part of the event log.

Provided Methods§

source

fn log_event<'life0, 'async_trait, E>( &'life0 mut self, log_ordering_wakeup_tx: Sender<()>, module_id: Option<ModuleInstanceId>, event: E, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where E: Event + Send + 'async_trait, Self: Send + 'async_trait, 'life0: 'async_trait,

Log an event log event

The event will start “unordered”, but after it is committed an ordering task will be notified to “order” it into a final ordered log.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'tx, Cap> DBTransactionEventLogExt for DatabaseTransaction<'tx, Cap>
where Cap: Send,

source§

fn log_event_raw<'life0, 'async_trait>( &'life0 mut self, log_ordering_wakeup_tx: Sender<()>, kind: EventKind, module_kind: Option<ModuleKind>, module_id: Option<ModuleInstanceId>, payload: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn get_next_event_log_id<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = EventLogId> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn get_event_log<'life0, 'async_trait>( &'life0 mut self, pos: Option<EventLogId>, limit: u64, ) -> Pin<Box<dyn Future<Output = Vec<(EventLogId, EventKind, Option<(ModuleKind, ModuleInstanceId)>, u64, Value)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§