Skip to main content

ruma_common/
lib.rs

1#![doc(html_favicon_url = "https://ruma.dev/favicon.ico")]
2#![doc(html_logo_url = "https://ruma.dev/images/logo.png")]
3//! Common types for the Ruma crates.
4
5#![recursion_limit = "1024"]
6#![warn(missing_docs)]
7// https://github.com/rust-lang/rust-clippy/issues/9029
8#![allow(clippy::derive_partial_eq_without_eq)]
9#![cfg_attr(docsrs, feature(doc_cfg))]
10
11#[cfg(not(all(feature = "client", feature = "server")))]
12compile_error!(
13    "ruma_common's `client` and `server` Cargo features only exist as a workaround are not meant to be disabled"
14);
15
16// Hack to allow both ruma-common itself and external crates (or tests) to use procedural macros
17// that expect `ruma_common` to exist in the prelude.
18extern crate self as ruma_common;
19
20#[cfg(feature = "api")]
21pub mod api;
22pub mod authentication;
23pub mod canonical_json;
24pub mod directory;
25pub mod encryption;
26#[cfg(feature = "api")]
27pub mod http_headers;
28mod identifiers;
29pub mod media;
30mod percent_encode;
31pub mod power_levels;
32pub mod presence;
33mod priv_owned_str;
34pub mod profile;
35pub mod push;
36pub mod room;
37pub mod room_version_rules;
38pub mod serde;
39pub mod third_party_invite;
40pub mod thirdparty;
41mod time;
42pub mod to_device;
43
44pub use self::{
45    canonical_json::{CanonicalJsonError, CanonicalJsonObject, CanonicalJsonValue},
46    identifiers::*,
47    time::{MilliSecondsSinceUnixEpoch, SecondsSinceUnixEpoch},
48};
49
50priv_owned_str!();
51
52/// Re-exports used by macro-generated code.
53///
54/// It is not considered part of this module's public API.
55#[doc(hidden)]
56pub mod exports {
57    #[cfg(feature = "api")]
58    pub use bytes;
59    #[cfg(feature = "api")]
60    pub use http;
61    pub use ruma_macros;
62    pub use serde;
63    pub use serde_html_form;
64    pub use serde_json;
65}