Trait EpochObserver

Source
pub trait EpochObserver: Send + Sync {
    // Required method
    fn epoch_changed<'life0, 'async_trait>(
        &'life0 self,
        conversation_id: ConversationId,
        epoch: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), EpochChangedReportingError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

An EpochObserver is notified whenever a conversation’s epoch changes.

Required Methods§

Source

fn epoch_changed<'life0, 'async_trait>( &'life0 self, conversation_id: ConversationId, epoch: u64, ) -> Pin<Box<dyn Future<Output = Result<(), EpochChangedReportingError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

This function will be called every time a conversation’s epoch changes.

The epoch parameter is the new epoch.

This function must not block! Foreign implementors of this inteface can spawn a task indirecting the notification, or (unblocking) send the notification on some kind of channel, or anything else, as long as the operation completes quickly.

Though the signature includes an error type, that error is only present because it is required by uniffi in order to handle panics. This function should suppress and ignore internal errors instead of propagating them, to the maximum extent possible.

Trait Implementations§

Source§

impl<T> FfiConverterArc<T> for dyn EpochObserver

Source§

const TYPE_ID_META: MetadataBuffer

Source§

type FfiType = *const c_void

Source§

fn lower(obj: Arc<Self>) -> Self::FfiType

Source§

fn try_lift(v: Self::FfiType) -> Result<Arc<Self>>

Source§

fn write(obj: Arc<Self>, buf: &mut Vec<u8>)

Source§

fn try_read(buf: &mut &[u8]) -> Result<Arc<Self>>

Source§

impl<T> LiftRef<T> for dyn EpochObserver

Implementors§