ruma_client_api/
lib.rs

1#![doc(html_favicon_url = "https://ruma.dev/favicon.ico")]
2#![doc(html_logo_url = "https://ruma.dev/images/logo.png")]
3//! (De)serializable types for the [Matrix Client-Server API][client-api].
4//! These types can be shared by client and server code.
5//!
6//! [client-api]: https://spec.matrix.org/latest/client-server-api/
7
8#![cfg(any(feature = "client", feature = "server"))]
9#![cfg_attr(docsrs, feature(doc_auto_cfg))]
10#![warn(missing_docs)]
11
12pub mod account;
13pub mod alias;
14pub mod appservice;
15pub mod authenticated_media;
16pub mod backup;
17pub mod config;
18pub mod context;
19#[cfg(feature = "unstable-msc3814")]
20pub mod dehydrated_device;
21#[cfg(feature = "unstable-msc4140")]
22pub mod delayed_events;
23pub mod device;
24pub mod directory;
25pub mod discovery;
26pub mod error;
27pub mod filter;
28pub mod http_headers;
29pub mod keys;
30pub mod knock;
31pub mod media;
32pub mod membership;
33pub mod message;
34pub mod presence;
35pub mod profile;
36pub mod push;
37pub mod read_marker;
38pub mod receipt;
39pub mod redact;
40pub mod relations;
41#[cfg(feature = "unstable-msc4108")]
42pub mod rendezvous;
43pub mod room;
44pub mod search;
45pub mod server;
46pub mod session;
47pub mod space;
48pub mod state;
49pub mod sync;
50pub mod tag;
51pub mod thirdparty;
52pub mod threads;
53pub mod to_device;
54pub mod typing;
55pub mod uiaa;
56pub mod user_directory;
57pub mod voip;
58
59use std::fmt;
60
61pub use error::Error;
62
63// Wrapper around `Box<str>` that cannot be used in a meaningful way outside of
64// this crate. Used for string enums because their `_Custom` variant can't be
65// truly private (only `#[doc(hidden)]`).
66#[doc(hidden)]
67#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
68pub struct PrivOwnedStr(Box<str>);
69
70impl fmt::Debug for PrivOwnedStr {
71    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
72        self.0.fmt(f)
73    }
74}