Skip to main content

xmtp_mls/
lib.rs

1#![recursion_limit = "256"]
2#![warn(clippy::unwrap_used)]
3
4pub mod attachments;
5pub mod builder;
6pub mod client;
7/// The client context, at its old path.
8pub mod context {
9    pub use crate::features::XmtpMlsLocalContext;
10    pub use crate::groups::context::XmtpSharedContext;
11    pub use xmtp_mls_core::context::*;
12}
13/// The core crate, at its old path.
14pub mod core {
15    pub use xmtp_mls_core::*;
16}
17mod definitions;
18#[cfg(any(test, feature = "diagnostics"))]
19pub mod diagnostics;
20pub mod features;
21pub mod groups;
22/// Core's identity with the identity crate's items, at their old paths.
23pub mod identity {
24    pub use xmtp_mls_core::identity::*;
25    pub use xmtp_mls_identity::identity_ext::*;
26    #[cfg(any(test, feature = "test-hooks"))]
27    pub use xmtp_mls_identity::identity_lifecycle::ENABLE_WELCOME_POINTERS;
28    #[cfg(any(test, feature = "test-hooks"))]
29    #[doc(hidden)]
30    pub use xmtp_mls_identity::identity_lifecycle::WelcomePointersHook;
31    pub use xmtp_mls_identity::identity_lifecycle::{
32        IdentityStrategy, XmtpKeyPackage, XmtpKeyPackageBuilder,
33    };
34}
35pub use xmtp_mls_identity::{identity_lifecycle, identity_updates, inbox_handles};
36mod intents;
37pub use xmtp_mls_core::mls_store;
38use xmtp_mls_core::mutex_registry;
39pub use xmtp_mls_messages as messages;
40pub mod prelude;
41/// The deployment's published configuration, at its old path.
42pub mod server_configuration {
43    pub use crate::core::config_refresh as worker;
44    pub use xmtp_mls_server_config::server_configuration::*;
45}
46use crate::core::state_tx;
47pub use client::VisibilityConfirmationOptions;
48pub use xmtp_mls_server_config::storage_location;
49pub mod subscriptions;
50pub mod task_handlers;
51pub mod utils;
52/// The core worker framework with the feature workers, at their old paths.
53pub mod worker {
54    pub mod device_sync;
55    pub use xmtp_mls_core::worker::*;
56    pub use xmtp_mls_identity::key_package_maintenance;
57    pub(crate) mod notifications;
58}
59#[cfg(test)]
60mod worker_tests;
61pub use definitions::*;
62
63#[cfg(any(test, feature = "test-utils"))]
64pub mod test;
65
66pub use client::{Client, Network};
67pub use xmtp_common as common;
68pub use xmtp_db as db;
69#[cfg(test)]
70use xmtp_db::DuplicateItem;
71use xmtp_db::StorageError;
72pub use xmtp_id::InboxOwner;
73/// The old `xmtp_mls_common` paths, now served by the three crates it split into.
74pub mod mls_common {
75    pub use xmtp_mls_group_keys::{commit_log, group_keys, mls_ext};
76    pub use xmtp_mls_group_state::{
77        app_data, group, group_metadata, group_mutable_metadata, inbox_id, libxmtp_version,
78    };
79    pub use xmtp_mls_tls_collections::{tls_map, tls_set};
80}
81pub use xmtp_mls_validation as mls_validation;
82pub use xmtp_proto::api_client::*;
83
84pub fn version() -> &'static str {
85    env!("CARGO_PKG_VERSION")
86}
87
88#[cfg_attr(not(target_arch = "wasm32"), ctor::ctor(unsafe))]
89#[cfg(all(test, not(target_arch = "wasm32")))]
90fn test_setup() {
91    xmtp_common::logger();
92    let _ = fdlimit::raise_fd_limit();
93}