matrix_sdk::event_cache::paginator

Trait PaginableRoom

Source
pub trait PaginableRoom: SendOutsideWasm + SyncOutsideWasm {
    // Required methods
    fn event_with_context(
        &self,
        event_id: &EventId,
        lazy_load_members: bool,
        num_events: UInt,
    ) -> impl Future<Output = Result<EventWithContextResponse, PaginatorError>> + SendOutsideWasm;
    fn messages(
        &self,
        opts: MessagesOptions,
    ) -> impl Future<Output = Result<Messages, PaginatorError>> + SendOutsideWasm;
}
Expand description

A room that can be paginated.

Not crate::Room because we may want to paginate rooms we don’t belong to.

Required Methods§

Source

fn event_with_context( &self, event_id: &EventId, lazy_load_members: bool, num_events: UInt, ) -> impl Future<Output = Result<EventWithContextResponse, PaginatorError>> + SendOutsideWasm

Runs a /context query for the given room.

§Parameters
  • event_id is the identifier of the target event.
  • lazy_load_members controls whether room membership events are lazily loaded as context state events.
  • num_events is the number of events (including the fetched event) to return as context.
§Returns

Must return PaginatorError::EventNotFound whenever the target event could not be found, instead of causing an http Err result.

Source

fn messages( &self, opts: MessagesOptions, ) -> impl Future<Output = Result<Messages, PaginatorError>> + SendOutsideWasm

Runs a /messages query for the given room.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§