veilid/veilid-core/src/lib.rs

90 lines
2.2 KiB
Rust
Raw Normal View History

2021-12-07 22:09:45 -05:00
#![deny(clippy::all)]
2021-12-09 16:11:52 -05:00
#![deny(unused_must_use)]
2022-06-27 23:46:29 -04: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 11:28:30 -05:00
#[macro_use]
extern crate alloc;
2022-06-07 21:31:05 -04:00
mod api_tracing_layer;
2021-11-22 11:28:30 -05:00
mod attachment_manager;
mod callback_state_machine;
2022-02-06 21:18:42 -05:00
mod core_context;
2022-10-30 19:29:31 -04:00
mod crypto;
2021-11-22 11:28:30 -05:00
mod intf;
mod network_manager;
mod receipt_manager;
mod routing_table;
mod rpc_processor;
mod veilid_api;
2022-07-06 23:15:51 -04:00
#[macro_use]
2021-11-22 11:28:30 -05:00
mod veilid_config;
2022-07-01 12:13:52 -04:00
mod veilid_layer_filter;
2021-11-22 11:28:30 -05:00
mod veilid_rng;
#[macro_use]
pub mod xx;
2022-06-07 21:31:05 -04:00
pub use self::api_tracing_layer::ApiTracingLayer;
2021-11-22 11:28:30 -05:00
pub use self::attachment_manager::AttachmentState;
2022-02-09 09:47:36 -05:00
pub use self::core_context::{api_startup, api_startup_json, UpdateCallback};
2021-11-22 11:28:30 -05:00
pub use self::veilid_api::*;
pub use self::veilid_config::*;
2022-07-01 12:13:52 -04:00
pub use self::veilid_layer_filter::*;
2021-11-22 11:28:30 -05:00
pub mod veilid_capnp {
include!(concat!(env!("OUT_DIR"), "/proto/veilid_capnp.rs"));
}
pub mod tests;
2022-01-27 22:02:16 -05: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-01-31 22:47:17 -05:00
2022-03-03 20:45:39 -05:00
#[cfg(target_os = "android")]
pub use intf::utils::android::{veilid_core_setup_android, veilid_core_setup_android_no_log};
2022-11-03 22:52:18 -04:00
pub static DEFAULT_LOG_IGNORE_LIST: [&str; 21] = [
2022-06-27 23:46:29 -04:00
"mio",
2022-06-29 10:13:49 -04:00
"h2",
"hyper",
"tower",
"tonic",
2022-11-03 22:52:18 -04:00
"tokio",
"runtime",
2022-06-29 10:13:49 -04:00
"tokio_util",
"want",
2022-06-27 23:46:29 -04:00
"serial_test",
2022-01-31 22:47:17 -05:00
"async_std",
"async_io",
"polling",
"rustls",
"async_tungstenite",
"tungstenite",
"netlink_proto",
"netlink_sys",
2022-05-17 16:55:53 -04:00
"trust_dns_resolver",
"trust_dns_proto",
2022-08-22 13:27:26 -04:00
"attohttpc",
2022-01-31 22:47:17 -05:00
];