2021-12-08 03:09:45 +00:00
|
|
|
#![deny(clippy::all)]
|
2021-12-09 21:11:52 +00:00
|
|
|
#![deny(unused_must_use)]
|
2022-11-30 14:39:12 +00:00
|
|
|
#![recursion_limit = "256"]
|
2022-06-28 03:46:29 +00:00
|
|
|
|
|
|
|
cfg_if::cfg_if! {
|
|
|
|
if #[cfg(target_arch = "wasm32")] {
|
|
|
|
#[cfg(any(feature = "rt-async-std", feature = "rt-tokio"))]
|
|
|
|
compile_error!("features \"rt-async-std\" and \"rt-tokio\" can not be specified for WASM");
|
|
|
|
} else {
|
|
|
|
#[cfg(all(feature = "rt-async-std", feature = "rt-tokio"))]
|
|
|
|
compile_error!(
|
|
|
|
"feature \"rt-async-std\" and feature \"rt-tokio\" cannot be enabled at the same time"
|
|
|
|
);
|
|
|
|
#[cfg(not(any(feature = "rt-async-std", feature = "rt-tokio")))]
|
|
|
|
compile_error!("exactly one of feature \"rt-async-std\" or feature \"rt-tokio\" must be specified");
|
|
|
|
}
|
|
|
|
}
|
2021-11-22 16:28:30 +00:00
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate alloc;
|
|
|
|
|
2022-06-08 01:31:05 +00:00
|
|
|
mod api_tracing_layer;
|
2021-11-22 16:28:30 +00:00
|
|
|
mod attachment_manager;
|
2022-02-07 02:18:42 +00:00
|
|
|
mod core_context;
|
2022-10-30 23:29:31 +00:00
|
|
|
mod crypto;
|
2021-11-22 16:28:30 +00:00
|
|
|
mod intf;
|
|
|
|
mod network_manager;
|
|
|
|
mod receipt_manager;
|
|
|
|
mod routing_table;
|
|
|
|
mod rpc_processor;
|
2023-05-29 19:24:57 +00:00
|
|
|
mod storage_manager;
|
|
|
|
mod table_store;
|
2021-11-22 16:28:30 +00:00
|
|
|
mod veilid_api;
|
|
|
|
mod veilid_config;
|
2022-07-01 16:13:52 +00:00
|
|
|
mod veilid_layer_filter;
|
2021-11-22 16:28:30 +00:00
|
|
|
|
2022-06-08 01:31:05 +00:00
|
|
|
pub use self::api_tracing_layer::ApiTracingLayer;
|
2022-02-09 14:47:36 +00:00
|
|
|
pub use self::core_context::{api_startup, api_startup_json, UpdateCallback};
|
2021-11-22 16:28:30 +00:00
|
|
|
pub use self::veilid_api::*;
|
|
|
|
pub use self::veilid_config::*;
|
2022-07-01 16:13:52 +00:00
|
|
|
pub use self::veilid_layer_filter::*;
|
2022-11-27 02:37:23 +00:00
|
|
|
pub use veilid_tools as tools;
|
2021-11-22 16:28:30 +00:00
|
|
|
|
|
|
|
pub mod veilid_capnp {
|
|
|
|
include!(concat!(env!("OUT_DIR"), "/proto/veilid_capnp.rs"));
|
|
|
|
}
|
|
|
|
|
|
|
|
pub mod tests;
|
2022-01-28 03:02:16 +00:00
|
|
|
|
|
|
|
pub fn veilid_version_string() -> String {
|
|
|
|
env!("CARGO_PKG_VERSION").to_owned()
|
|
|
|
}
|
|
|
|
pub fn veilid_version() -> (u32, u32, u32) {
|
|
|
|
(
|
|
|
|
u32::from_str(env!("CARGO_PKG_VERSION_MAJOR")).unwrap(),
|
|
|
|
u32::from_str(env!("CARGO_PKG_VERSION_MINOR")).unwrap(),
|
|
|
|
u32::from_str(env!("CARGO_PKG_VERSION_PATCH")).unwrap(),
|
|
|
|
)
|
|
|
|
}
|
2022-02-01 03:47:17 +00:00
|
|
|
|
2022-03-04 01:45:39 +00:00
|
|
|
#[cfg(target_os = "android")]
|
2022-12-01 19:32:02 +00:00
|
|
|
pub use intf::android::veilid_core_setup_android;
|
2022-03-04 01:45:39 +00:00
|
|
|
|
2022-11-04 02:52:18 +00:00
|
|
|
pub static DEFAULT_LOG_IGNORE_LIST: [&str; 21] = [
|
2022-06-28 03:46:29 +00:00
|
|
|
"mio",
|
2022-06-29 14:13:49 +00:00
|
|
|
"h2",
|
|
|
|
"hyper",
|
|
|
|
"tower",
|
|
|
|
"tonic",
|
2022-11-04 02:52:18 +00:00
|
|
|
"tokio",
|
|
|
|
"runtime",
|
2022-06-29 14:13:49 +00:00
|
|
|
"tokio_util",
|
|
|
|
"want",
|
2022-06-28 03:46:29 +00:00
|
|
|
"serial_test",
|
2022-02-01 03:47:17 +00:00
|
|
|
"async_std",
|
|
|
|
"async_io",
|
|
|
|
"polling",
|
|
|
|
"rustls",
|
|
|
|
"async_tungstenite",
|
|
|
|
"tungstenite",
|
|
|
|
"netlink_proto",
|
|
|
|
"netlink_sys",
|
2022-05-17 20:55:53 +00:00
|
|
|
"trust_dns_resolver",
|
|
|
|
"trust_dns_proto",
|
2022-08-22 17:27:26 +00:00
|
|
|
"attohttpc",
|
2022-02-01 03:47:17 +00:00
|
|
|
];
|
2022-11-30 00:22:33 +00:00
|
|
|
|
2023-06-08 18:07:09 +00:00
|
|
|
use cfg_if::*;
|
|
|
|
use enumset::*;
|
|
|
|
use eyre::{bail, eyre, Report as EyreReport, Result as EyreResult, WrapErr};
|
|
|
|
use futures_util::stream::FuturesUnordered;
|
2023-07-15 20:18:13 +00:00
|
|
|
use parking_lot::*;
|
2023-06-08 18:07:09 +00:00
|
|
|
use schemars::{schema_for, JsonSchema};
|
|
|
|
use serde::*;
|
|
|
|
use stop_token::*;
|
|
|
|
use thiserror::Error as ThisError;
|
2023-07-15 20:18:13 +00:00
|
|
|
use tracing::*;
|
|
|
|
use veilid_tools::*;
|