pub struct MessageIter {
pub total: Option<i32>,
/* private fields */
}Expand description
Cursor-based iterator over message history. Created by Client::iter_messages.
Fields§
§total: Option<i32>Total message count from the first server response (messages.Slice).
None until the first page is fetched, None for messages.Messages
(which returns an exact slice with no separate count).
Implementations§
Source§impl MessageIter
impl MessageIter
Sourcepub fn total(&self) -> Option<i32>
pub fn total(&self) -> Option<i32>
Total message count from the first server response.
Returns None before the first next call, or for chats
where the server returns an exact (non-slice) response.
Sourcepub async fn next(
&mut self,
client: &Client,
) -> Result<Option<IncomingMessage>, InvocationError>
pub async fn next( &mut self, client: &Client, ) -> Result<Option<IncomingMessage>, InvocationError>
Fetch the next message (newest first). Returns None when all messages have been yielded.
Auto Trait Implementations§
impl Freeze for MessageIter
impl RefUnwindSafe for MessageIter
impl Send for MessageIter
impl Sync for MessageIter
impl Unpin for MessageIter
impl UnsafeUnpin for MessageIter
impl UnwindSafe for MessageIter
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> 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