Skip to main content

OutgoingRequest

Struct OutgoingRequest 

Source
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: RequestId

This crate’s own correlation id — the shell passes it back unchanged to crate::MessengerError-surfacing calls (a later piece) alongside the response.

§method: HttpMethod

The HTTP method to use.

§path: String

The 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: OutgoingRequestKind

What kind of call this is.

Implementations§

Source§

impl OutgoingRequest

Source

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.

Source

pub fn keys_upload(id: RequestId, body: Value) -> Self

POST /_matrix/client/v3/keys/upload.

Source

pub fn keys_query(id: RequestId, body: Value) -> Self

POST /_matrix/client/v3/keys/query.

Source

pub fn keys_claim(id: RequestId, body: Value) -> Self

POST /_matrix/client/v3/keys/claim.

Source

pub fn keys_changes(id: RequestId, from: &str, to: &str) -> Self

GET /_matrix/client/v3/keys/changes.

Source

pub fn send_to_device( id: RequestId, event_type: &str, txn_id: &TxnId, body: Value, ) -> Self

PUT /_matrix/client/v3/sendToDevice/{eventType}/{txnId}.

Source

pub fn signing_keys_upload(id: RequestId, body: Value) -> Self

POST /_matrix/client/v3/keys/device_signing/upload.

Source

pub fn signatures_upload(id: RequestId, body: Value) -> Self

POST /_matrix/client/v3/keys/signatures/upload.

Source

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

Source

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

Source

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.

Source

pub fn room_messages( id: RequestId, room_id: &RoomId, from: &str, dir: &str, limit: Option<u32>, ) -> Self

GET /_matrix/client/v3/rooms/{roomId}/messages.

Source

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.

Source

pub fn room_members(id: RequestId, room_id: &RoomId) -> Self

GET /_matrix/client/v3/rooms/{roomId}/members.

Source

pub fn create_room(id: RequestId, body: Value) -> Self

POST /_matrix/client/v3/createRoom.

Source

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

Source

pub fn leave_room(id: RequestId, room_id: &RoomId) -> Self

POST /_matrix/client/v3/rooms/{roomId}/leave.

Source

pub fn invite(id: RequestId, room_id: &RoomId, user_id: &UserId) -> Self

POST /_matrix/client/v3/rooms/{roomId}/invite.

Source

pub fn kick( id: RequestId, room_id: &RoomId, user_id: &UserId, reason: Option<&str>, ) -> Self

POST /_matrix/client/v3/rooms/{roomId}/kick.

Source

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

Source

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

Source

pub fn receipt( id: RequestId, room_id: &RoomId, receipt_type: &str, event_id: &EventId, ) -> Self

POST /_matrix/client/v3/rooms/{roomId}/receipt/{receiptType}/{eventId}.

Source

pub fn read_markers(id: RequestId, room_id: &RoomId, body: Value) -> Self

POST /_matrix/client/v3/rooms/{roomId}/read_markers.

Source

pub fn account_data( id: RequestId, user_id: &UserId, event_type: &str, body: Value, ) -> Self

PUT /_matrix/client/v3/user/{userId}/account_data/{type}.

Source

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

Source

pub fn profile(id: RequestId, user_id: &UserId) -> Self

GET /_matrix/client/v3/profile/{userId}.

POST /_matrix/client/v3/user_directory/search.

Source

pub fn public_rooms(id: RequestId, body: Value) -> Self

POST /_matrix/client/v3/publicRooms.

Source

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

Source

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

Trait Implementations§

Source§

impl Clone for OutgoingRequest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OutgoingRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for OutgoingRequest

Source§

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

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for OutgoingRequest

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for OutgoingRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for OutgoingRequest

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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