Struct ruma::api::appservice::event::push_events::v1::IncomingRequest[][src]

pub struct IncomingRequest {
    pub txn_id: String,
    pub events: Vec<Raw<AnyRoomEvent>, Global>,
}
This is supported on crate feature api and (crate features appservice-api or appservice-api-c or appservice-api-s) only.
Expand description

‘Incoming’ variant of Request.

Fields

txn_id: String

The transaction ID for this set of events.

Homeservers generate these IDs and they are used to ensure idempotency of results.

events: Vec<Raw<AnyRoomEvent>, Global>

A list of events.

Implementations

Creates an IncomingRequest with the given transaction ID and list of events.

Consumes the IncomingRequest and tries to convert it to a sync_events::Response

This is a helper conversion in cases where it’s easier to work with sync_events::Response instead of the original push_events::IncomingRequest. It puts all events with a room_id into the JoinedRoom’s timeline. The rationale behind that is that incoming Appservice transactions from the homeserver are not necessarily bound to a specific user but can cover a multitude of namespaces, and as such the Appservice basically only “observes joined rooms”.

Note: Currently homeservers only push PDUs to appservices, no EDUs. There’s the open MSC2409 regarding supporting EDUs in the future, though it seems to be planned to put EDUs into a different JSON key than events to stay backwards compatible.

Trait Implementations

Formats the value using the given formatter. Read more

A type capturing the error conditions that can be returned in the response.

Response type to return when the request is successful.

Metadata about the endpoint.

Tries to turn the given http::Request into this request type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

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

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

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

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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