matrix_sdk/
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#![warn(missing_debug_implementations, missing_docs)]
18#![cfg_attr(target_family = "wasm", allow(clippy::arc_with_non_send_sync))]
19#![cfg_attr(docsrs, feature(doc_cfg))]
20
21pub use async_trait::async_trait;
22pub use bytes;
23#[cfg(feature = "e2e-encryption")]
24pub use matrix_sdk_base::crypto;
25pub use matrix_sdk_base::{
26    ComposerDraft, ComposerDraftType, EncryptionState, PredecessorRoom, QueueWedgeError,
27    Room as BaseRoom, RoomCreateWithCreatorEventContent, RoomDisplayName, RoomHero, RoomInfo,
28    RoomMember as BaseRoomMember, RoomMemberships, RoomRecencyStamp, RoomState, SessionMeta,
29    StateChanges, StateStore, StoreError, SuccessorRoom, ThreadingSupport, deserialized_responses,
30    store::{self, DynStateStore, MemoryStore, StateStoreExt},
31};
32pub use matrix_sdk_common::*;
33pub use reqwest;
34
35mod account;
36pub mod attachment;
37pub mod authentication;
38mod client;
39pub mod config;
40mod deduplicating_handler;
41#[cfg(feature = "e2e-encryption")]
42pub mod encryption;
43mod error;
44pub mod event_cache;
45pub mod event_handler;
46mod http_client;
47pub mod latest_events;
48pub mod media;
49pub mod notification_settings;
50pub mod paginators;
51pub mod pusher;
52pub mod room;
53pub mod room_directory_search;
54pub mod room_preview;
55pub mod send_queue;
56pub mod utils;
57pub mod futures {
58    //! Named futures returned from methods on types in [the crate root][crate].
59
60    pub use super::client::futures::SendRequest;
61}
62pub mod sliding_sync;
63pub mod sync;
64#[cfg(feature = "experimental-widgets")]
65pub mod widget;
66
67pub use account::Account;
68pub use authentication::{AuthApi, AuthSession, SessionTokens};
69#[cfg(feature = "experimental-search")]
70pub mod search_index;
71pub use client::{
72    Client, ClientBuildError, ClientBuilder, LoopCtrl, ServerVendorInfo, SessionChange,
73    sanitize_server_name,
74};
75pub use error::{
76    Error, HttpError, HttpResult, NotificationSettingsError, RefreshTokenError, Result,
77    RumaApiError,
78};
79pub use http_client::TransmissionProgress;
80#[cfg(all(feature = "e2e-encryption", feature = "sqlite"))]
81pub use matrix_sdk_sqlite::SqliteCryptoStore;
82#[cfg(feature = "sqlite")]
83pub use matrix_sdk_sqlite::{
84    STATE_STORE_DATABASE_NAME, SqliteEventCacheStore, SqliteMediaStore, SqliteStateStore,
85    SqliteStoreConfig,
86};
87pub use media::Media;
88pub use pusher::Pusher;
89pub use room::Room;
90pub use ruma::{IdParseError, OwnedServerName, ServerName};
91pub use sliding_sync::{
92    SlidingSync, SlidingSyncBuilder, SlidingSyncList, SlidingSyncListBuilder,
93    SlidingSyncListLoadingState, SlidingSyncMode, UpdateSummary,
94};
95
96#[cfg(feature = "uniffi")]
97uniffi::setup_scaffolding!();
98
99pub mod live_location_share;
100#[cfg(any(test, feature = "testing"))]
101pub mod test_utils;
102
103#[cfg(test)]
104matrix_sdk_test_utils::init_tracing_for_tests!();