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§
Sourcefn all(
&self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, Error>> + Send + '_>>
fn all( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, Error>> + Send + '_>>
Load all messages (filtered by DM visibility).
Sourcefn tail(
&self,
n: usize,
) -> 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 + '_>>
Load the last n messages (filtered by DM visibility).