[][src]Crate ruma

Types and traits for working with the Matrix protocol.

This crate re-exports things from all of the other ruma crates so you don't have to manually keep all the versions in sync.

Which crates are re-exported can be configured through cargo features. Depending on which parts of Matrix are relevant to you, activate the following features:

  • client-api for the client-server API
  • federation-api for the server-server (federation) API
  • appservice-api for the application service API

Re-exports

pub use assign::assign;
pub use js_int::int;
pub use js_int::uint;
pub use js_int::Int;
pub use js_int::UInt;

Modules

authentication

Common types for authentication.

directory

Common types for room directory endpoints

encryption

Common types for encryption related tasks.

identifiers

Crate ruma_identifiers contains types for Matrix identifiers for events, rooms, room aliases, room versions, and users.

presence

Common types for the presence module

push

Common types for the push notifications module

serde

De-/serialization helpers for other ruma crates

thirdparty

Common types for the third party networks module

user_id

Matrix user identifiers.

Macros

device_id

Shorthand for Box::<DeviceId>::from.

device_key_id

Compile-time checked DeviceKeyId construction.

event_id

Compile-time checked EventId construction.

room_alias_id

Compile-time checked RoomAliasId construction.

room_id

Compile-time checked RoomId construction.

room_version_id

Compile-time checked RoomVersionId construction.

server_key_idDeprecated

Compile-time checked ServerSigningKeyId construction.

server_name

Compile-time checked ServerName construction.

server_signing_key_id

Compile-time checked ServerSigningKeyId construction.

user_id

Compile-time checked UserId construction.

Structs

DeviceId

A Matrix key ID.

DeviceKeyId

A key algorithm and a device id, combined with a ':'

EventId

A Matrix event ID.

RoomAliasId

A Matrix room alias ID.

RoomId

A Matrix room ID.

RoomIdOrAliasId

A Matrix room ID or a Matrix room alias ID.

ServerName

A Matrix-spec compliant server name.

UserId

A Matrix user ID.

Enums

DeviceKeyAlgorithm

The basic key algorithms in the specification.

RoomVersionId

A Matrix room version ID.

SigningKeyAlgorithm

The signing key algorithms defined in the Matrix spec.

Traits

Outgoing

A type that can be sent to another party that understands the matrix protocol. If any of the fields of Self don't implement serde's Deserialize, you can derive this trait to generate a corresponding 'Incoming' type that supports deserialization. This is useful for things like ruma_events' EventResult type. For more details, see the derive macro's documentation.

Type Definitions

ServerSigningKeyId

Algorithm + key name for homeserver signing keys.

Derive Macros

Outgoing

Derive the Outgoing trait, possibly generating an 'Incoming' version of the struct this derive macro is used on. Specifically, if no lifetime variables are used on any of the fields of the struct, this simple implementation will be generated: