matrix_sdk_base/
lib.rs

1// Copyright 2020 Damir Jelić
2// Copyright 2020 The Matrix.org Foundation C.I.C.
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//     http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#![doc = include_str!("../README.md")]
17#![cfg_attr(docsrs, feature(doc_auto_cfg))]
18#![cfg_attr(target_family = "wasm", allow(clippy::arc_with_non_send_sync))]
19#![warn(missing_docs, missing_debug_implementations)]
20
21pub use matrix_sdk_common::*;
22use ruma::{OwnedDeviceId, OwnedUserId};
23use serde::{Deserialize, Serialize};
24
25pub use crate::error::{Error, Result};
26
27mod client;
28pub use client::RequestedRequiredStates;
29pub mod debug;
30pub mod deserialized_responses;
31mod error;
32pub mod event_cache;
33pub mod latest_event;
34pub mod media;
35pub mod notification_settings;
36mod response_processors;
37mod room;
38
39pub mod read_receipts;
40pub mod sliding_sync;
41
42pub mod store;
43pub mod sync;
44#[cfg(any(test, feature = "testing"))]
45mod test_utils;
46mod utils;
47
48#[cfg(feature = "experimental-element-recent-emojis")]
49pub mod recent_emojis;
50
51#[cfg(feature = "uniffi")]
52uniffi::setup_scaffolding!();
53
54pub use client::{BaseClient, ThreadingSupport};
55#[cfg(any(test, feature = "testing"))]
56pub use http;
57#[cfg(feature = "e2e-encryption")]
58pub use matrix_sdk_crypto as crypto;
59pub use once_cell;
60pub use room::{
61    EncryptionState, InviteAcceptanceDetails, PredecessorRoom, Room,
62    RoomCreateWithCreatorEventContent, RoomDisplayName, RoomHero, RoomInfo, RoomInfoNotableUpdate,
63    RoomInfoNotableUpdateReasons, RoomMember, RoomMembersUpdate, RoomMemberships, RoomRecencyStamp,
64    RoomState, RoomStateFilter, SuccessorRoom, apply_redaction,
65};
66pub use store::{
67    ComposerDraft, ComposerDraftType, QueueWedgeError, StateChanges, StateStore, StateStoreDataKey,
68    StateStoreDataValue, StoreError, ThreadSubscriptionCatchupToken,
69};
70pub use utils::{
71    MinimalRoomMemberEvent, MinimalStateEvent, OriginalMinimalStateEvent, RedactedMinimalStateEvent,
72};
73
74#[cfg(test)]
75matrix_sdk_test_utils::init_tracing_for_tests!();
76
77/// The Matrix user session info.
78#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
79pub struct SessionMeta {
80    /// The ID of the session's user.
81    pub user_id: OwnedUserId,
82    /// The ID of the client device.
83    pub device_id: OwnedDeviceId,
84}