pub struct HistoryReader { /* private fields */ }Expand description
Scoped read-only handle to a room’s chat history.
Respects DM visibility — a plugin invoked by user X will not see DMs between Y and Z.
Implements HistoryAccess so it can be passed as
Box<dyn HistoryAccess> in [CommandContext].
Trait Implementations§
Source§impl HistoryAccess for HistoryReader
impl HistoryAccess for HistoryReader
Source§fn 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).
Source§fn 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).Auto Trait Implementations§
impl Freeze for HistoryReader
impl RefUnwindSafe for HistoryReader
impl Send for HistoryReader
impl Sync for HistoryReader
impl Unpin for HistoryReader
impl UnsafeUnpin for HistoryReader
impl UnwindSafe for HistoryReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more