[][src]Crate matrix_sdk_base

This crate implements a Matrix client library.

Crate Feature Flags

The following crate feature flags are available:

  • encryption: Enables end-to-end encryption support in the library.
  • sqlite_cryptostore: Enables a SQLite based store for the encryption keys. If this is disabled and encryption support is enabled the keys will by default be stored only in memory and thus lost after the client is destroyed.
  • unstable-synapse-quirks: Enables support to deal with inconsistencies of Synapse in compliance with the Matrix API specification.

Re-exports

pub use matrix_sdk_crypto as crypto;

Modules

api

Crate ruma_client_api contains serializable types for the requests and responses for each endpoint in the Matrix client API specification. These types can be shared by client and server code.

directory

Common types for room directory endpoints

encryption

Common types for encryption related tasks.

events

Crate ruma_events contains serializable types for the events in the Matrix specification that can be shared by client and server code.

instant
locks
presence

Common types for the presence module

push

Common types for the push notifications module

thirdparty

Common types for the third party networks module

uuid

Generate and parse UUIDs.

Macros

assign

Mutate a struct value in a declarative style.

int

Creates an Int from a numeric literal.

uint

Creates a UInt from a numeric literal.

Structs

AllRooms

JsonStore::load_all_rooms returns AllRooms.

BaseClient

A no IO Client implementation.

BaseClientConfig

Configuration for the creation of the BaseClient.

ClientState

ClientState holds all the information to restore a BaseClient except the access_token as the default store is not secure.

Int

An integer limited to the range of integers that can be represented exactly by an f64.

JsonStore

A default StateStore implementation that serializes state as json and saves it to disk.

MessageQueue

A queue that holds the 35 most recent messages received from the server.

Raw

A wrapper around Box<RawValue>, to be used in place of any type in the Matrix endpoint definition to allow request and response types to contain that said type represented by the generic argument Ev.

Room

A Matrix room.

RoomMember

A Matrix room member.

Session

A user session, containing an access token and information about the associated user account.

UInt

An integer limited to the range of non-negative integers that can be represented exactly by an f64.

Enums

AuthScheme

Authentication scheme used by the endpoint.

CanonicalJsonValue
CustomEvent

This represents the various "unrecognized" events.

Error

Internal representation of errors.

FromHttpRequestError

An error when converting a http request to one of ruma's endpoint-specific request types.

FromHttpResponseError

An error when converting a http response to one of Ruma's endpoint-specific response types.

IntoHttpError

An error when converting one of ruma's endpoint-specific request or response types to the corresponding http type.

RoomState

An enum that represents the state of the given Room.

RoomStateType

Signals to the BaseClient which RoomState to send to EventEmitter.

ServerError

An error was reported by the server (HTTP status code 4xx or 5xx)

Traits

AsyncTraitDeps

Super trait that is used for our store traits, this trait will differ if it's used on WASM. WASM targets will not require Send and Sync to have implemented, while other targets will.

EndpointError

Gives users the ability to define their own serializable / deserializable errors.

EventEmitter

This trait allows any type implementing EventEmitter to specify event callbacks for each event. The Client calls each method when the corresponding event is received.

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.

OutgoingRequest

A request type for a Matrix API endpoint. (trait used for sending requests)

PossiblyRedactedExt

Exposes some of the field access methods found in the event held by AnyPossiblyRedacted* enums.

StateStore

Abstraction around the data store to avoid unnecessary request on client initialization.

Type Definitions

Result

Result type of the rust-sdk.

SyncRoom

Type alias for RoomState enum when passed to EventEmitter methods.

Attribute Macros

async_trait

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: