pub struct ThreadedEventsLoader<P: PaginableThread> { /* private fields */ }Expand description
A paginator for a thread of events.
Implementations§
Source§impl<P: PaginableThread> ThreadedEventsLoader<P>
impl<P: PaginableThread> ThreadedEventsLoader<P>
Sourcepub fn new(
room: P,
root_event_id: OwnedEventId,
tokens: PaginationTokens,
) -> Self
pub fn new( room: P, root_event_id: OwnedEventId, tokens: PaginationTokens, ) -> Self
Create a new ThreadedEventsLoader, given a room implementation.
Sourcepub async fn paginate_backwards(
&self,
num_events: UInt,
) -> Result<PaginationResult, PaginatorError>
pub async fn paginate_backwards( &self, num_events: UInt, ) -> Result<PaginationResult, PaginatorError>
Run a single pagination backwards, returning the next set of events and information whether we’ve reached the start of the thread.
Note: when the thread start is reached, the root event will be included in the result.
Sourcepub async fn paginate_forwards(
&self,
num_events: UInt,
) -> Result<PaginationResult, PaginatorError>
pub async fn paginate_forwards( &self, num_events: UInt, ) -> Result<PaginationResult, PaginatorError>
Run a single pagination forwards, returning the next set of events and information whether we’ve reached the end of the thread.
Sourcepub fn thread_root_event_id(&self) -> &EventId
pub fn thread_root_event_id(&self) -> &EventId
Returns the root EventId for the thread.
Trait Implementations§
Auto Trait Implementations§
impl<P> !Freeze for ThreadedEventsLoader<P>
impl<P> RefUnwindSafe for ThreadedEventsLoader<P>where
P: RefUnwindSafe,
impl<P> Send for ThreadedEventsLoader<P>
impl<P> Sync for ThreadedEventsLoader<P>
impl<P> Unpin for ThreadedEventsLoader<P>where
P: Unpin,
impl<P> UnwindSafe for ThreadedEventsLoader<P>where
P: UnwindSafe,
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, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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