pub struct OutgoingRequest {
pub id: RequestId,
pub method: HttpMethod,
pub path: String,
pub query: Vec<(String, String)>,
pub body: Option<Value>,
pub kind: OutgoingRequestKind,
}Expand description
One HTTP call the core wants a shell to perform. The core never performs the call itself — see the crate doc’s “Contract” section.
Fields§
§id: RequestIdThis crate’s own correlation id — the shell passes it back
unchanged to crate::MessengerError-surfacing calls (a later
piece) alongside the response.
method: HttpMethodThe HTTP method to use.
path: StringThe request path, already percent-encoded and rooted at
/_matrix/client/v3/... — ready to append to a homeserver base URL
verbatim.
query: Vec<(String, String)>Query-string parameters as (name, value) pairs, not yet
percent-encoded (a shell’s own HTTP client is expected to encode
query parameters itself, the same way it encodes any other query
string it builds).
body: Option<Value>The JSON request body, if this call has one.
kind: OutgoingRequestKindWhat kind of call this is.
Implementations§
Source§impl OutgoingRequest
impl OutgoingRequest
Sourcepub fn sync(id: RequestId, since: Option<&str>, timeout_ms: Option<u64>) -> Self
pub fn sync(id: RequestId, since: Option<&str>, timeout_ms: Option<u64>) -> Self
GET /_matrix/client/v3/sync. Always carries [SYNC_FILTER]: the
server reports a room this account left, or was kicked or banned from,
in rooms.leave only when the filter asks for it.
Sourcepub fn keys_upload(id: RequestId, body: Value) -> Self
pub fn keys_upload(id: RequestId, body: Value) -> Self
POST /_matrix/client/v3/keys/upload.
Sourcepub fn keys_query(id: RequestId, body: Value) -> Self
pub fn keys_query(id: RequestId, body: Value) -> Self
POST /_matrix/client/v3/keys/query.
Sourcepub fn keys_claim(id: RequestId, body: Value) -> Self
pub fn keys_claim(id: RequestId, body: Value) -> Self
POST /_matrix/client/v3/keys/claim.
Sourcepub fn keys_changes(id: RequestId, from: &str, to: &str) -> Self
pub fn keys_changes(id: RequestId, from: &str, to: &str) -> Self
GET /_matrix/client/v3/keys/changes.
Sourcepub fn send_to_device(
id: RequestId,
event_type: &str,
txn_id: &TxnId,
body: Value,
) -> Self
pub fn send_to_device( id: RequestId, event_type: &str, txn_id: &TxnId, body: Value, ) -> Self
PUT /_matrix/client/v3/sendToDevice/{eventType}/{txnId}.
Sourcepub fn signing_keys_upload(id: RequestId, body: Value) -> Self
pub fn signing_keys_upload(id: RequestId, body: Value) -> Self
POST /_matrix/client/v3/keys/device_signing/upload.
Sourcepub fn signatures_upload(id: RequestId, body: Value) -> Self
pub fn signatures_upload(id: RequestId, body: Value) -> Self
POST /_matrix/client/v3/keys/signatures/upload.
Sourcepub fn room_send(
id: RequestId,
room_id: &RoomId,
event_type: &str,
txn_id: &TxnId,
body: Value,
) -> Self
pub fn room_send( id: RequestId, room_id: &RoomId, event_type: &str, txn_id: &TxnId, body: Value, ) -> Self
PUT /_matrix/client/v3/rooms/{roomId}/send/{eventType}/{txnId}.
Sourcepub fn room_redact(
id: RequestId,
room_id: &RoomId,
event_id: &EventId,
txn_id: &TxnId,
body: Value,
) -> Self
pub fn room_redact( id: RequestId, room_id: &RoomId, event_id: &EventId, txn_id: &TxnId, body: Value, ) -> Self
PUT /_matrix/client/v3/rooms/{roomId}/redact/{eventId}/{txnId}.
Sourcepub fn room_state(
id: RequestId,
room_id: &RoomId,
event_type: &str,
state_key: &str,
body: Value,
) -> Self
pub fn room_state( id: RequestId, room_id: &RoomId, event_type: &str, state_key: &str, body: Value, ) -> Self
PUT /_matrix/client/v3/rooms/{roomId}/state/{eventType}/{stateKey}.
state_key may be "" (the spec’s own empty state key), which
percent-encodes to an empty final path segment.
Sourcepub fn room_messages(
id: RequestId,
room_id: &RoomId,
from: &str,
dir: &str,
limit: Option<u32>,
) -> Self
pub fn room_messages( id: RequestId, room_id: &RoomId, from: &str, dir: &str, limit: Option<u32>, ) -> Self
GET /_matrix/client/v3/rooms/{roomId}/messages.
Sourcepub fn room_messages_latest(id: RequestId, room_id: &RoomId, limit: u32) -> Self
pub fn room_messages_latest(id: RequestId, room_id: &RoomId, limit: u32) -> Self
Latest page, dir=b, no from. The server starts at the tip.
An encrypted push carries no ciphertext, and a /sync token that
has already moved on will not return that event again.
Sourcepub fn room_members(id: RequestId, room_id: &RoomId) -> Self
pub fn room_members(id: RequestId, room_id: &RoomId) -> Self
GET /_matrix/client/v3/rooms/{roomId}/members.
Sourcepub fn create_room(id: RequestId, body: Value) -> Self
pub fn create_room(id: RequestId, body: Value) -> Self
POST /_matrix/client/v3/createRoom.
Sourcepub fn join_room(id: RequestId, room_id: &str) -> Self
pub fn join_room(id: RequestId, room_id: &str) -> Self
POST /_matrix/client/v3/rooms/{roomId}/join. This crate only ever
joins by room id. It does not speak /join/{roomIdOrAlias}.
Sourcepub fn leave_room(id: RequestId, room_id: &RoomId) -> Self
pub fn leave_room(id: RequestId, room_id: &RoomId) -> Self
POST /_matrix/client/v3/rooms/{roomId}/leave.
Sourcepub fn invite(id: RequestId, room_id: &RoomId, user_id: &UserId) -> Self
pub fn invite(id: RequestId, room_id: &RoomId, user_id: &UserId) -> Self
POST /_matrix/client/v3/rooms/{roomId}/invite.
Sourcepub fn kick(
id: RequestId,
room_id: &RoomId,
user_id: &UserId,
reason: Option<&str>,
) -> Self
pub fn kick( id: RequestId, room_id: &RoomId, user_id: &UserId, reason: Option<&str>, ) -> Self
POST /_matrix/client/v3/rooms/{roomId}/kick.
Sourcepub fn set_state(
id: RequestId,
room_id: &RoomId,
event_type: &str,
state_key: &str,
content: Value,
) -> Self
pub fn set_state( id: RequestId, room_id: &RoomId, event_type: &str, state_key: &str, content: Value, ) -> Self
PUT /_matrix/client/v3/rooms/{roomId}/state/{eventType}/{stateKey}.
Sourcepub fn typing(
id: RequestId,
room_id: &RoomId,
user_id: &UserId,
typing: bool,
timeout_ms: Option<u64>,
) -> Self
pub fn typing( id: RequestId, room_id: &RoomId, user_id: &UserId, typing: bool, timeout_ms: Option<u64>, ) -> Self
PUT /_matrix/client/v3/rooms/{roomId}/typing/{userId}.
Sourcepub fn receipt(
id: RequestId,
room_id: &RoomId,
receipt_type: &str,
event_id: &EventId,
) -> Self
pub fn receipt( id: RequestId, room_id: &RoomId, receipt_type: &str, event_id: &EventId, ) -> Self
POST /_matrix/client/v3/rooms/{roomId}/receipt/{receiptType}/{eventId}.
Sourcepub fn read_markers(id: RequestId, room_id: &RoomId, body: Value) -> Self
pub fn read_markers(id: RequestId, room_id: &RoomId, body: Value) -> Self
POST /_matrix/client/v3/rooms/{roomId}/read_markers.
Sourcepub fn account_data(
id: RequestId,
user_id: &UserId,
event_type: &str,
body: Value,
) -> Self
pub fn account_data( id: RequestId, user_id: &UserId, event_type: &str, body: Value, ) -> Self
PUT /_matrix/client/v3/user/{userId}/account_data/{type}.
Sourcepub fn room_account_data(
id: RequestId,
user_id: &UserId,
room_id: &RoomId,
event_type: &str,
body: Value,
) -> Self
pub fn room_account_data( id: RequestId, user_id: &UserId, room_id: &RoomId, event_type: &str, body: Value, ) -> Self
PUT /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type}.
Sourcepub fn profile(id: RequestId, user_id: &UserId) -> Self
pub fn profile(id: RequestId, user_id: &UserId) -> Self
GET /_matrix/client/v3/profile/{userId}.
Sourcepub fn user_directory_search(id: RequestId, body: Value) -> Self
pub fn user_directory_search(id: RequestId, body: Value) -> Self
POST /_matrix/client/v3/user_directory/search.
Sourcepub fn public_rooms(id: RequestId, body: Value) -> Self
pub fn public_rooms(id: RequestId, body: Value) -> Self
POST /_matrix/client/v3/publicRooms.
Sourcepub fn backup_version(id: RequestId) -> Self
pub fn backup_version(id: RequestId) -> Self
GET /_matrix/client/v3/room_keys/version — the current backup
version. Creating/updating a version is a different endpoint,
deferred to whichever piece implements key backup (plan §5, M9).
Sourcepub fn backup_keys(
id: RequestId,
room_id: &RoomId,
session_id: &str,
version: &str,
) -> Self
pub fn backup_keys( id: RequestId, room_id: &RoomId, session_id: &str, version: &str, ) -> Self
GET /_matrix/client/v3/room_keys/keys/{roomId}/{sessionId} — the
single-session lookup shape the plan’s §4.3 UTD-recovery walkthrough
uses. The bulk (/room_keys/keys) and per-room
(/room_keys/keys/{roomId}) variants are deferred to M9, which owns
key backup end to end (plan §6.8: exact backup paths/queries are
still open pending the sibling server plan).