SeenTracker

Trait SeenTracker 

Source
pub trait SeenTracker {
    // Required methods
    fn mark_seen<'life0, 'async_trait>(
        &'life0 self,
        msg_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_seen<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg_id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn cleanup_old<'life0, 'async_trait>(
        &'life0 self,
        max_age: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A trait for tracking seen messages.

Required Methods§

Source

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

Marks a message as seen.

§Arguments
  • msg_id - The Uuid of the message to mark as seen.
§Errors

This function will return an error if the message cannot be marked as seen.

Source

fn is_seen<'life0, 'life1, 'async_trait>( &'life0 self, msg_id: &'life1 Uuid, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Checks if a message has been seen.

§Arguments
  • msg_id - The Uuid of the message to check.
§Returns

true if the message has been seen, false otherwise.

§Errors

This function will return an error if the seen status cannot be retrieved.

Source

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

Cleans up old seen message records.

§Arguments
  • max_age - The maximum age for seen records to be retained.
§Errors

This function will return an error if cleanup fails.

Implementors§