pub enum TimelineUpdate {
Show 15 variants
FirstUpdate {
initial_items: Vector<Arc<TimelineItem>>,
},
NewItems {
new_items: Vector<Arc<TimelineItem>>,
changed_indices: Range<usize>,
is_append: bool,
clear_cache: bool,
},
NewUnreadMessagesCount(UnreadMessageCount),
TargetEventFound {
target_event_id: OwnedEventId,
index: usize,
},
PaginationRunning(PaginationDirection),
PaginationError {
error: Error,
direction: PaginationDirection,
},
PaginationIdle {
fully_paginated: bool,
direction: PaginationDirection,
},
EventDetailsFetched {
event_id: OwnedEventId,
result: Result<(), Error>,
},
MessageEdited {
timeline_event_id: TimelineEventItemId,
result: Result<(), Error>,
},
RoomMembersSynced,
RoomMembersListFetched {
members: Vec<RoomMember>,
},
MediaFetched,
TypingUsers {
users: Vec<String>,
},
UserPowerLevels(UserPowerLevels),
OwnUserReadReceipt(Receipt),
}Expand description
A message that is sent from a background async task to a room’s timeline view for the purpose of update the Timeline UI contents or metadata.
Variants§
FirstUpdate
The very first update a given room’s timeline receives.
Fields
initial_items: Vector<Arc<TimelineItem>>The initial list of timeline items (events) for a room.
NewItems
The content of a room’s timeline was updated in the background.
Fields
new_items: Vector<Arc<TimelineItem>>The entire list of timeline items (events) for a room.
changed_indices: Range<usize>The range of indices in the items list that have been changed in this update
and thus must be removed from any caches of drawn items in the timeline.
Any items outside of this range are assumed to be unchanged and need not be redrawn.
NewUnreadMessagesCount(UnreadMessageCount)
The updated number of unread messages in the room.
TargetEventFound
The target event ID was found at the given index in the timeline items vector.
This means that the RoomScreen widget can scroll the timeline up to this event,
and the background timeline_subscriber_handler async task can stop looking for this event.
PaginationRunning(PaginationDirection)
A notice that the background task doing pagination for this room is currently running a pagination request in the given direction, and is waiting for that request to complete.
PaginationError
An error occurred while paginating the timeline for this room.
PaginationIdle
A notice that the background task doing pagination for this room has become idle, meaning that it has completed its recent pagination request(s).
Fields
fully_paginated: boolIf true, the start of the timeline has been reached, meaning that
there is no need to send further pagination requests.
direction: PaginationDirectionEventDetailsFetched
A notice that event details have been fetched from the server,
including a result that indicates whether the request was successful.
MessageEdited
The result of a request to edit a message in this timeline.
RoomMembersSynced
A notice that the room’s members have been fetched from the server,
though the success or failure of the request is not yet known until the client
requests the member info via a timeline event’s sender_profile() method.
RoomMembersListFetched
A notice that the room’s full member list has been fetched from the server, includes a complete list of room members that can be shared across components. This is different from RoomMembersSynced which only indicates members were fetched but doesn’t provide the actual data.
Fields
members: Vec<RoomMember>MediaFetched
A notice that one or more requested media items (images, videos, etc.) that should be displayed in this timeline have now been fetched and are available.
TypingUsers
A notice that one or more members of a this room are currently typing.
Fields
UserPowerLevels(UserPowerLevels)
An update containing the currently logged-in user’s power levels for this room.
OwnUserReadReceipt(Receipt)
An update to the currently logged-in user’s own read receipt for this room.
Auto Trait Implementations§
impl !Freeze for TimelineUpdate
impl !RefUnwindSafe for TimelineUpdate
impl Send for TimelineUpdate
impl Sync for TimelineUpdate
impl Unpin for TimelineUpdate
impl !UnwindSafe for TimelineUpdate
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
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>
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>
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