ruma_common

Module api

Source
Available on crate feature api only.
Expand description

Core types used to define the requests and responses for each endpoint in the various Matrix API specifications.

When implementing a new Matrix API, each endpoint has a request type which implements IncomingRequest and OutgoingRequest, and a response type connected via an associated type.

An implementation of IncomingRequest or OutgoingRequest contains all the information about the HTTP method, the path and input parameters for requests, and the structure of a successful response. Such types can then be used by client code to make requests, and by server code to fulfill those requests.

Modules§

error
This module contains types for all kinds of errors that can occur when converting between http requests / responses and ruma’s representation of matrix API requests / responses.

Structs§

Metadata
Metadata about an API endpoint.
VersionHistory
The complete history of this endpoint as far as Ruma knows, together with all variants on versions stable and unstable.

Enums§

AuthScheme
Authentication scheme used by the endpoint.
Direction
The direction to return events from.
MatrixVersion
The Matrix versions Ruma currently understands to exist.
SendAccessToken
An enum to control whether an access token should be added to outgoing requests
VersioningDecision
A versioning “decision” derived from a set of Matrix versions.

Traits§

EndpointError
Gives users the ability to define their own serializable / deserializable errors.
IncomingRequest
A request type for a Matrix API endpoint, used for receiving requests.
IncomingResponse
A response type for a Matrix API endpoint, used for receiving responses.
OutgoingRequest
A request type for a Matrix API endpoint, used for sending requests.
OutgoingRequestAppserviceExt
An extension to OutgoingRequest which provides Appservice specific methods.
OutgoingResponse
A request type for a Matrix API endpoint, used for sending responses.

Attribute Macros§

request
Generates OutgoingRequest and IncomingRequest implementations.
response
Generates OutgoingResponse and IncomingResponse implementations.