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 address;
38pub mod fmt;
39pub mod hex;
40pub mod http;
41pub mod rate_limit;
42pub mod snippet;
43pub mod time;
44pub mod types;
45
46pub mod r#const;
47pub use r#const::*;
48
49mod event_logging;
50pub use event_logging::*;
51
52pub use xmtp_cryptography::hash::*;
53pub use xmtp_cryptography::rand::*;
54
55pub mod telemetry;
56// Re-exported at the crate root: `::xmtp_common::bind_task_hub` is what the span
57// macros emit and what call sites use.
58pub use telemetry::bind_task_hub;
59
60pub use xmtp_macro::db_span;
61pub use xmtp_macro::err_span;
62pub use xmtp_macro::log_event;
63pub use xmtp_macro::mls_span;
64pub use xmtp_macro::rpc_span;
65pub use xmtp_macro::span;
66pub use xmtp_macro::timeout;