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