pub enum MatrixRequest {
Show 28 variants
PaginateTimeline {
timeline_kind: TimelineKind,
num_events: u16,
direction: PaginationDirection,
},
EditMessage {
timeline_kind: TimelineKind,
timeline_event_item_id: TimelineEventItemId,
edited_content: EditedContent,
},
FetchDetailsForEvent {
timeline_kind: TimelineKind,
event_id: OwnedEventId,
},
CreateThreadTimeline {
room_id: OwnedRoomId,
thread_root_event_id: OwnedEventId,
sender: Sender<()>,
},
SyncRoomMemberList {
timeline_kind: TimelineKind,
},
JoinRoom {
room_id: OwnedRoomId,
},
LeaveRoom {
room_id: OwnedRoomId,
},
GetRoomMembers {
timeline_kind: TimelineKind,
memberships: RoomMemberships,
local_only: bool,
},
GetUserProfile {
user_id: OwnedUserId,
room_id: Option<OwnedRoomId>,
local_only: bool,
sender: Option<Sender<Option<UserProfile>>>,
},
GetNumberUnreadMessages {
timeline_kind: TimelineKind,
},
IgnoreUser {
ignore: bool,
room_member: RoomMember,
room_id: OwnedRoomId,
},
ResolveRoomAlias(OwnedRoomAliasId),
FetchMedia {
media_request: MediaRequestParameters,
content_sender: Sender<Result<Vec<u8>, Error>>,
},
SendTextMessage {
timeline_kind: TimelineKind,
message: String,
replied_to_id: Option<OwnedEventId>,
},
SendTypingNotice {
room_id: OwnedRoomId,
typing: bool,
},
SubscribeToTypingNotices {
room_id: OwnedRoomId,
subscribe: bool,
},
SubscribeToOwnUserReadReceiptsChanged {
timeline_kind: TimelineKind,
subscribe: bool,
},
ReadReceipt {
timeline_kind: TimelineKind,
event_id: OwnedEventId,
receipt_type: ReceiptType,
},
MarkRoomAsRead {
timeline_kind: TimelineKind,
},
GetRoomPowerLevels {
timeline_kind: TimelineKind,
},
ToggleReaction {
timeline_kind: TimelineKind,
timeline_event_id: TimelineEventItemId,
reaction: String,
},
RedactMessage {
timeline_kind: TimelineKind,
timeline_event_id: TimelineEventItemId,
reason: Option<String>,
},
GetMatrixRoomLinkPillInfo {
matrix_id: MatrixId,
via: Vec<OwnedServerName>,
},
SearchUsers {
search_term: String,
limit: u64,
content_sender: Sender<Result<Vec<ProfileModel>, Error>>,
},
CreateDMRoom {
user_id: OwnedUserId,
},
CreateRoom {
room_name: String,
room_avatar: Option<OwnedMxcUri>,
invited_user_ids: Vec<OwnedUserId>,
topic: Option<String>,
},
InviteUsersInRoom {
room_id: OwnedRoomId,
invited_user_ids: Vec<OwnedUserId>,
},
KickOrBanUserFromRoom {
room_id: OwnedRoomId,
user_id: OwnedUserId,
reason: Option<String>,
is_ban: bool,
},
}Expand description
The set of requests for async work that can be made to the worker thread.
Variants§
PaginateTimeline
Request to paginate the older (or newer) events of a room or thread timeline.
EditMessage
Request to edit the content of an event in the given room’s timeline.
Fields
timeline_kind: TimelineKindtimeline_event_item_id: TimelineEventItemIdedited_content: EditedContentFetchDetailsForEvent
Request to fetch the full details of the given event in the given room’s timeline.
CreateThreadTimeline
Request to create a thread timeline focused on the given thread root event in the given room.
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
timeline_kind: TimelineKindJoinRoom
Request to join the given room.
Fields
room_id: OwnedRoomIdLeaveRoom
Request to leave the given room.
Fields
room_id: OwnedRoomIdGetRoomMembers
Request to get the actual list of members in a room. This returns the list of members that can be displayed in the UI.
GetUserProfile
Request to fetch profile information for the given user ID.
Fields
user_id: OwnedUserIdroom_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.
sender: Option<Sender<Option<UserProfile>>>matrix-svelte-client: sender used if a command is awaiting for the profile. We send it directly through this channel
GetNumberUnreadMessages
Request to fetch the number of unread messages in the given room.
Fields
timeline_kind: TimelineKindIgnoreUser
Request to ignore/block or unignore/unblock a user.
Fields
room_member: RoomMemberThe room membership info of the user to (un)ignore.
room_id: OwnedRoomIdThe 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.
SendTextMessage
Request to send a message to the given room.
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).
SubscribeToTypingNotices
Subscribe to typing notices for the given room.
This request does not return a response or notify the UI thread.
Fields
room_id: OwnedRoomIdSubscribeToOwnUserReadReceiptsChanged
Subscribe to changes in the read receipts of our own user.
This request does not return a response or notify the UI thread.
ReadReceipt
Sends a read receipt for the given event in the given room.
MarkRoomAsRead
Sends a read receipt in the given room.
Fields
timeline_kind: TimelineKindGetRoomPowerLevels
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
timeline_kind: TimelineKindToggleReaction
Toggles the given reaction to the given event in the given room.
RedactMessage
Redacts (deletes) the given event in the given room.
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.
SearchUsers
CreateDMRoom
Create a DM room with a given UserId
Fields
user_id: OwnedUserIdCreateRoom
Create a Matrix room
InviteUsersInRoom
Invite a list of users to a room
KickOrBanUserFromRoom
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MatrixRequest
impl<'de> Deserialize<'de> for MatrixRequest
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MatrixRequest
impl !RefUnwindSafe for MatrixRequest
impl Send for MatrixRequest
impl Sync for MatrixRequest
impl Unpin for MatrixRequest
impl UnsafeUnpin for MatrixRequest
impl !UnwindSafe for MatrixRequest
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> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for 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