Skip to main content

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#![recursion_limit = "256"]
17#![doc = include_str!("../README.md")]
18#![warn(missing_debug_implementations, missing_docs)]
19#![cfg_attr(target_family = "wasm", allow(clippy::arc_with_non_send_sync))]
20#![cfg_attr(docsrs, feature(doc_cfg))]
21
22pub use async_trait::async_trait;
23pub use bytes;
24pub use matrix_sdk_base::{
25    CallIntentConsensus, ComposerDraft, ComposerDraftType, DraftAttachment, DraftAttachmentContent,
26    DraftThumbnail, EncryptionState, PredecessorRoom, QueueWedgeError, Room as BaseRoom,
27    RoomCreateWithCreatorEventContent, RoomDisplayName, RoomHero, RoomHeroWithProfile, 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;
49mod media_metrics;
50pub mod notification_settings;
51pub mod paginators;
52pub mod pusher;
53pub mod room;
54pub mod room_directory_search;
55pub mod room_preview;
56pub mod send_queue;
57pub mod utils;
58pub mod futures {
59    //! Named futures returned from methods on types in [the crate root][crate].
60
61    pub use super::client::futures::SendRequest;
62}
63pub mod sliding_sync;
64pub mod sync;
65#[cfg(feature = "experimental-widgets")]
66pub mod widget;
67
68#[cfg(feature = "experimental-search")]
69pub mod message_search;
70
71pub use account::Account;
72pub use authentication::{AuthApi, AuthSession, SessionTokens};
73pub use client::homeserver_capabilities::HomeserverCapabilities;
74#[cfg(feature = "experimental-search")]
75pub mod search_index;
76pub use client::{
77    Client, ClientBuildError, ClientBuilder, LoopCtrl, ServerVendorInfo, SessionChange, StoreSizes,
78    TileServerInfo, ToDeviceMessage, WeakClient, sanitize_server_name,
79};
80pub use error::{
81    BeaconError, Error, HttpError, HttpResult, NotificationSettingsError, RefreshTokenError,
82    Result, RumaApiError,
83};
84pub use http_client::{SupportedAuthScheme, SupportedPathBuilder, TransmissionProgress};
85#[cfg(all(feature = "e2e-encryption", feature = "sqlite"))]
86pub use matrix_sdk_sqlite::SqliteCryptoStore;
87#[cfg(feature = "sqlite")]
88pub use matrix_sdk_sqlite::{
89    EVENT_CACHE_STORE_DATABASE_NAME, MEDIA_STORE_DATABASE_NAME, STATE_STORE_DATABASE_NAME,
90    SqliteEventCacheStore, SqliteMediaStore, SqliteStateStore, SqliteStoreConfig, Synchronous,
91};
92pub use media::Media;
93pub use media_metrics::{MediaMetrics, MediaType, MediaUsage};
94pub use pusher::Pusher;
95pub use room::Room;
96pub use ruma::{IdParseError, OwnedServerName, ServerName};
97pub use sliding_sync::{
98    SlidingSync, SlidingSyncBuilder, SlidingSyncList, SlidingSyncListBuilder,
99    SlidingSyncListLoadingState, SlidingSyncMode, UpdateSummary,
100};
101
102#[cfg(feature = "uniffi")]
103uniffi::setup_scaffolding!();
104
105pub mod live_locations_observer;
106
107#[cfg(feature = "unstable-msc4426")]
108mod automatic_call_status;
109
110#[cfg(any(test, feature = "testing"))]
111pub mod test_utils;
112
113#[cfg(test)]
114matrix_sdk_test_utils::init_tracing_for_tests!();