Enum TimelineUpdate

Source
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.

§is_append: bool

An optimization that informs the UI whether the changes to the timeline resulted in new items being appended to the end of the timeline.

§clear_cache: bool

Whether to clear the entire cache of drawn items in the timeline. This supersedes index_of_first_change and is used when the entire timeline is being 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.

Fields

§target_event_id: OwnedEventId
§index: usize
§

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.

Fields

§error: Error
§

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: bool

If true, the start of the timeline has been reached, meaning that there is no need to send further pagination requests.

§

EventDetailsFetched

A notice that event details have been fetched from the server, including a result that indicates whether the request was successful.

Fields

§event_id: OwnedEventId
§result: Result<(), Error>
§

MessageEdited

The result of a request to edit a message in this timeline.

Fields

§timeline_event_id: TimelineEventItemId
§result: Result<(), Error>
§

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

§users: Vec<String>

The list of users (their displayable name) who are currently typing in this room.

§

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Any for T
where T: Any,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> SendOutsideWasm for T
where T: Send,

Source§

impl<T> SyncOutsideWasm for T
where T: Sync,