Skip to main content

nexus_toolkit/
lib.rs

1//! # Nexus Toolkit
2//!
3//! The Nexus Toolkit is a Rust library that provides a trait to define a Nexus
4//! Tool. A Nexus Tool is a service that can be invoked over HTTP. The Toolkit
5//! automatically generates the necessary endpoints for the Tool.
6//!
7//! See more documentation at <https://github.com/Talus-Network/gitbook-docs/blob/production/nexus-sdk/toolkit-rust.md>
8
9mod config;
10
11/// Shared test utilities
12#[cfg(test)]
13pub(crate) mod test_utils {
14    /// Serialize tests that use ENV_TOOLKIT_CONFIG_PATH to avoid race conditions
15    pub static ENV_VAR_LOCK: std::sync::Mutex<()> = std::sync::Mutex::new(());
16}
17mod nexus_tool;
18#[doc(hidden)]
19pub mod runtime;
20mod serde_tracked;
21mod signed_http_warp;
22
23pub use {
24    anyhow::Result as AnyResult,
25    config::{SignedHttpMode, ToolkitRuntimeConfig, ENV_TOOLKIT_CONFIG_PATH},
26    env_logger,
27    log::debug,
28    nexus_tool::{AuthContext, NexusTool},
29    serde_tracked::*,
30    warp::{self, http::StatusCode},
31};
32// Re-exported for use by the `bootstrap!` macro. Not part of the public API.
33#[doc(hidden)]
34pub use {reqwest, serde_json};