Struct ruma::api::appservice::event::push_events::v1::IncomingRequest [−][src]
pub struct IncomingRequest {
pub txn_id: String,
pub events: Vec<Raw<AnyRoomEvent>, Global>,
}
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
type EndpointError = MatrixError
type EndpointError = MatrixError
A type capturing the error conditions that can be returned in the response.
type OutgoingResponse = Response
type OutgoingResponse = Response
Response type to return when the request is successful.
pub fn try_from_http_request<T>(
request: Request<T>
) -> Result<IncomingRequest, FromHttpRequestError> where
T: AsRef<[u8]>,
pub fn try_from_http_request<T>(
request: Request<T>
) -> Result<IncomingRequest, FromHttpRequestError> where
T: AsRef<[u8]>,
Tries to turn the given http::Request
into this request type.
Auto Trait Implementations
impl RefUnwindSafe for IncomingRequest
impl Send for IncomingRequest
impl Sync for IncomingRequest
impl Unpin for IncomingRequest
impl UnwindSafe for IncomingRequest
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V
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