Crate matrix_sdk_base

Source
Expand description

This crate implements the base to build a Matrix client library.

§Crate Feature Flags

The following crate feature flags are available:

  • encryption: Enables end-to-end encryption support in the library.
  • qrcode: Enables QRcode generation and reading code.
  • testing: Provides facilities and functions for tests, in particular for integration testing store implementations. ATTENTION: do not ever use outside of tests, we do not provide any stability warantees on these, these are merely helpers. If you find you need any function provided here outside of tests, please open a Github Issue and inform us about your use case for us to consider.

Re-exports§

pub use read_receipts::PreviousEventsProvider;
pub use store::ComposerDraft;
pub use store::ComposerDraftType;
pub use store::QueueWedgeError;
pub use store::StateChanges;
pub use store::StateStore;
pub use store::StateStoreDataKey;
pub use store::StateStoreDataValue;
pub use store::StoreError;
pub use http;testing
pub use matrix_sdk_crypto as crypto;e2e-encryption
pub use once_cell;

Modules§

debug
Helpers for creating std::fmt::Debug implementations.
deserialized_responses
SDK-specific variations of response types from Ruma.
event_cache
Event cache store and common types shared with matrix_sdk::event_cache.
executor
Abstraction over an executor so we can spawn tasks under WASM the same way we do usually.
failures_cache
A TTL cache which can be used to time out repeated operations that might experience intermittent failures.
latest_event
Utilities for working with events to decide whether they are suitable for use as a crate::Room::latest_event.
linked_chunk
A linked chunk is the underlying data structure that holds all events.
locks
Simplified locks hat panic instead of returning a Result when the lock is poisoned.
media
Common types for media content.
notification_settings
Some shared types about notification settings.
read_receipts
Client-side read receipts computation
ring_buffer
ruma
Types and traits for working with the Matrix protocol.
sleep
sliding_sync
Extend BaseClient with capabilities to handle MSC4186.
store
The state store holds the overall state for rooms, users and their profiles and their timelines. It is an overall cache for faster access and convenience- accessible through Store.
store_locks
Collection of small helpers that implement store-based locks.
sync
The SDK’s representation of the result of a /sync request.
timeout
tracing_timer
ttl_cache
A TTL cache which can be used to time out repeated operations that might experience intermittent failures.

Macros§

boxed_into_future
event_cache_store_integration_teststesting
Macro building to allow your EventCacheStore implementation to run the entire tests suite locally.
event_cache_store_integration_tests_timetesting
Macro generating tests for the event cache store, related to time (mostly for the cross-process lock).
event_cache_store_media_integration_teststesting
Macro building to allow your EventCacheStoreMedia implementation to run the entire tests suite locally.
statestore_integration_teststesting
Macro building to allow your StateStore implementation to run the entire tests suite locally.
timer
Macro to create a RAII timer that will log a tracing event once it’s dropped.

Structs§

BaseClient
A no IO Client implementation.
OriginalMinimalStateEvent
An unredacted minimal state event.
RedactedMinimalStateEvent
A redacted minimal state event.
Room
The underlying room data structure collecting state for joined, left and invited rooms.
RoomCreateWithCreatorEventContent
The content of an m.room.create event, with a required creator field.
RoomHero
Information about a member considered to be a room hero.
RoomInfo
The underlying pure data structure for joined and left rooms.
RoomInfoNotableUpdate
Indicates that a notable update of RoomInfo has been applied, and why.
RoomInfoNotableUpdateReasons
The reason why a RoomInfoNotableUpdate is emitted.
RoomMember
A member of a room.
RoomMemberships
Room membership filter as a bitset.
RoomStateFilter
Room state filter as a bitset.
SessionMeta
The Matrix user session info.

Enums§

Error
Internal representation of errors.
MinimalStateEvent
A minimal state event.
RoomDisplayName
The name of the room, either from the metadata or calculated according to matrix specification
RoomMembersUpdate
The kind of room member updates that just happened.
RoomState
Enum keeping track in which state the room is, e.g. if our own user is joined, RoomState::Invited, or has left the room.

Constants§

LEASE_DURATION_MS
Amount of time a lease of the lock should last, in milliseconds.

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.
SendOutsideWasmNon-WebAssembly
Alias for Send on non-wasm, empty trait (implemented by everything) on wasm.
SyncOutsideWasmNon-WebAssembly
Alias for Sync on non-wasm, empty trait (implemented by everything) on wasm.

Functions§

apply_redaction
Apply a redaction to the given target event, given the raw redaction event and the room version.

Type Aliases§

BoxFutureNon-WebAssembly
MinimalRoomMemberEvent
A minimal m.room.member event.
Result
Result type of the rust-sdk.