Skip to main content

HistoryAccess

Trait HistoryAccess 

Source
pub trait HistoryAccess: Send + Sync {
    // Required methods
    fn all(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, Error>> + Send + '_>>;
    fn tail(
        &self,
        n: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, Error>> + Send + '_>>;
    fn since(
        &self,
        message_id: &str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, Error>> + Send + '_>>;
    fn count(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + '_>>;
}
Expand description

Async read-only access to a room’s chat history.

Respects DM visibility — a plugin invoked by user X will not see DMs between Y and Z.

Required Methods§

Source

fn all( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, Error>> + Send + '_>>

Load all messages (filtered by DM visibility).

Source

fn tail( &self, n: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, Error>> + Send + '_>>

Load the last n messages (filtered by DM visibility).

Source

fn since( &self, message_id: &str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, Error>> + Send + '_>>

Load messages after the one with the given ID (filtered by DM visibility).

Source

fn count( &self, ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + '_>>

Count total messages in the chat.

Implementors§