MatrixRequest

Enum MatrixRequest 

Source
pub enum MatrixRequest {
Show 23 variants PaginateRoomTimeline { room_id: OwnedRoomId, num_events: u16, direction: PaginationDirection, }, EditMessage { room_id: OwnedRoomId, timeline_event_item_id: TimelineEventItemId, edited_content: EditedContent, }, FetchDetailsForEvent { room_id: OwnedRoomId, event_id: OwnedEventId, }, SyncRoomMemberList { room_id: OwnedRoomId, }, JoinRoom { room_id: OwnedRoomId, }, LeaveRoom { room_id: OwnedRoomId, }, GetRoomMembers { room_id: OwnedRoomId, memberships: RoomMemberships, local_only: bool, }, GetUserProfile { user_id: OwnedUserId, room_id: Option<OwnedRoomId>, local_only: bool, }, GetNumberUnreadMessages { room_id: OwnedRoomId, }, IgnoreUser { ignore: bool, room_member: RoomMember, room_id: OwnedRoomId, }, ResolveRoomAlias(OwnedRoomAliasId), FetchMedia { media_request: MediaRequestParameters, content_sender: Sender<Result<Vec<u8>, Error>>, }, SendMessage { room_id: OwnedRoomId, message: RoomMessageEventContent, replied_to: Option<Reply>, }, SendTypingNotice { room_id: OwnedRoomId, typing: bool, }, SubscribeToTypingNotices { room_id: OwnedRoomId, subscribe: bool, }, SubscribeToOwnUserReadReceiptsChanged { room_id: OwnedRoomId, subscribe: bool, }, ReadReceipt { room_id: OwnedRoomId, event_id: OwnedEventId, }, FullyReadReceipt { room_id: OwnedRoomId, event_id: OwnedEventId, }, GetRoomPowerLevels { room_id: OwnedRoomId, }, ToggleReaction { room_id: OwnedRoomId, timeline_event_id: TimelineEventItemId, reaction: String, }, RedactMessage { room_id: OwnedRoomId, timeline_event_id: TimelineEventItemId, reason: Option<String>, }, GetMatrixRoomLinkPillInfo { matrix_id: MatrixId, via: Vec<OwnedServerName>, }, CreateDMRoom { user_id: OwnedUserId, },
}
Expand description

The set of requests for async work that can be made to the worker thread.

Variants§

§

PaginateRoomTimeline

Request to paginate the older (or newer) events of a room’s timeline.

Fields

§room_id: OwnedRoomId
§num_events: u16

The maximum number of timeline events to fetch in each pagination batch.

§direction: PaginationDirection
§

EditMessage

Request to edit the content of an event in the given room’s timeline.

Fields

§room_id: OwnedRoomId
§timeline_event_item_id: TimelineEventItemId
§edited_content: EditedContent
§

FetchDetailsForEvent

Request to fetch the full details of the given event in the given room’s timeline.

Fields

§room_id: OwnedRoomId
§event_id: OwnedEventId
§

SyncRoomMemberList

Request to fetch profile information for all members of a room. This can be very slow depending on the number of members in the room.

Fields

§room_id: OwnedRoomId
§

JoinRoom

Request to join the given room.

Fields

§room_id: OwnedRoomId
§

LeaveRoom

Request to leave the given room.

Fields

§room_id: OwnedRoomId
§

GetRoomMembers

Request to get the actual list of members in a room. This returns the list of members that can be displayed in the UI.

Fields

§room_id: OwnedRoomId
§memberships: RoomMemberships
§local_only: bool
  • If true (not recommended), only the local cache will be accessed.
  • If false (recommended), details will be fetched from the server.
§

GetUserProfile

Request to fetch profile information for the given user ID.

Fields

§user_id: OwnedUserId
§room_id: Option<OwnedRoomId>
  • If Some, the user is known to be a member of a room, so this will fetch the user’s profile from that room’s membership info.
  • If None, the user’s profile info will be fetched from the server in a room-agnostic manner, and no room membership info will be returned.
§local_only: bool
  • If true (not recommended), only the local cache will be accessed.
  • If false (recommended), details will be fetched from the server.
§

GetNumberUnreadMessages

Request to fetch the number of unread messages in the given room.

Fields

§room_id: OwnedRoomId
§

IgnoreUser

Request to ignore/block or unignore/unblock a user.

Fields

§ignore: bool

Whether to ignore (true) or unignore (false) the user.

§room_member: RoomMember

The room membership info of the user to (un)ignore.

§room_id: OwnedRoomId

The room ID of the room where the user is a member, which is only needed because it isn’t present in the RoomMember object.

§

ResolveRoomAlias(OwnedRoomAliasId)

Request to resolve a room alias into a room ID and the servers that know about that room.

§

FetchMedia

Request to fetch media from the server. Upon completion of the async media request, the on_fetched function will be invoked with four arguments: the destination, the media_request, the result of the media fetch, and the update_sender.

Fields

§content_sender: Sender<Result<Vec<u8>, Error>>
§

SendMessage

Request to send a message to the given room.

Fields

§room_id: OwnedRoomId
§replied_to: Option<Reply>
§

SendTypingNotice

Sends a notice to the given room that the current user is or is not typing.

This request does not return a response or notify the UI thread, and furthermore, there is no need to send a follow-up request to stop typing (though you certainly can do so).

Fields

§room_id: OwnedRoomId
§typing: bool
§

SubscribeToTypingNotices

Subscribe to typing notices for the given room.

This request does not return a response or notify the UI thread.

Fields

§room_id: OwnedRoomId
§subscribe: bool

Whether to subscribe or unsubscribe from typing notices for this room.

§

SubscribeToOwnUserReadReceiptsChanged

Subscribe to changes in the read receipts of our own user.

This request does not return a response or notify the UI thread.

Fields

§room_id: OwnedRoomId
§subscribe: bool

Whether to subscribe or unsubscribe to changes in the read receipts of our own user for this room

§

ReadReceipt

Sends a read receipt for the given event in the given room.

Fields

§room_id: OwnedRoomId
§event_id: OwnedEventId
§

FullyReadReceipt

Sends a fully-read receipt for the given event in the given room.

Fields

§room_id: OwnedRoomId
§event_id: OwnedEventId
§

GetRoomPowerLevels

Sends a request to obtain the power levels for this room.

The response is delivered back to the main UI thread via [TimelineUpdate::UserPowerLevels].

Fields

§room_id: OwnedRoomId
§

ToggleReaction

Toggles the given reaction to the given event in the given room.

Fields

§room_id: OwnedRoomId
§timeline_event_id: TimelineEventItemId
§reaction: String
§

RedactMessage

Redacts (deletes) the given event in the given room.

Fields

§room_id: OwnedRoomId
§timeline_event_id: TimelineEventItemId
§reason: Option<String>
§

GetMatrixRoomLinkPillInfo

Sends a request to obtain the room’s pill link info for the given Matrix ID.

The MatrixLinkPillInfo::Loaded variant is sent back to the main UI thread via.

Fields

§matrix_id: MatrixId
§

CreateDMRoom

Fields

§user_id: OwnedUserId

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for MatrixRequest

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

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

Source§

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