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 push;
35pub mod room;
36pub mod room_version_rules;
37pub mod serde;
38pub mod third_party_invite;
39pub mod thirdparty;
40mod time;
41pub mod to_device;
42
43pub use self::{
44    canonical_json::{CanonicalJsonError, CanonicalJsonObject, CanonicalJsonValue},
45    identifiers::*,
46    time::{MilliSecondsSinceUnixEpoch, SecondsSinceUnixEpoch},
47};
48
49priv_owned_str!();
50
51/// Re-exports used by macro-generated code.
52///
53/// It is not considered part of this module's public API.
54#[doc(hidden)]
55pub mod exports {
56    #[cfg(feature = "api")]
57    pub use bytes;
58    #[cfg(feature = "api")]
59    pub use http;
60    pub use ruma_macros;
61    pub use serde;
62    pub use serde_html_form;
63    pub use serde_json;
64}