Skip to main content

xmtp_common/
lib.rs

1//! Common types shared among all XMTP Crates
2// required to be able to use xmtp_macros::async_trait in this crate
3extern crate self as xmtp_common;
4
5mod macros;
6
7mod error_code;
8pub use error_code::ErrorCode;
9
10#[doc(inline)]
11pub use xmtp_macro::ErrorCode;
12
13#[cfg(any(test, feature = "test-utils"))]
14mod test;
15#[cfg(any(test, feature = "test-utils"))]
16pub use test::*;
17
18#[doc(inline)]
19#[cfg(any(test, feature = "test-utils"))]
20pub use xmtp_macro::test;
21
22#[doc(inline)]
23pub use xmtp_macro::async_trait;
24
25#[cfg(feature = "bench")]
26pub mod bench;
27
28pub mod retry;
29pub use retry::*;
30
31pub mod wasm;
32pub use wasm::*;
33
34pub mod stream_handles;
35pub use stream_handles::*;
36
37pub mod fmt;
38pub mod hex;
39pub mod http;
40pub mod rate_limit;
41pub mod snippet;
42pub mod time;
43pub mod types;
44
45pub mod r#const;
46pub use r#const::*;
47
48mod event_logging;
49pub use event_logging::*;
50
51pub use xmtp_cryptography::hash::*;
52pub use xmtp_cryptography::rand::*;
53
54pub mod telemetry;
55// Re-exported at the crate root: `::xmtp_common::bind_task_hub` is what the span
56// macros emit and what call sites use.
57pub use telemetry::bind_task_hub;
58
59pub use xmtp_macro::db_span;
60pub use xmtp_macro::err_span;
61pub use xmtp_macro::log_event;
62pub use xmtp_macro::mls_span;
63pub use xmtp_macro::rpc_span;
64pub use xmtp_macro::span;
65pub use xmtp_macro::timeout;