1 // Copyright 2023 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 //! Netsim daemon libraries. 16 17 use std::sync::OnceLock; 18 use tokio::runtime::{Handle, Runtime}; 19 20 static RUNTIME: OnceLock<Runtime> = OnceLock::new(); 21 22 /// Retrieves a handle to a shared, lazily initialized Tokio runtime. get_runtime() -> Handle23pub fn get_runtime() -> Handle { 24 RUNTIME.get_or_init(|| Runtime::new().unwrap()).handle().clone() 25 } 26 27 mod args; 28 mod bluetooth; 29 pub mod captures; 30 mod config_file; 31 mod devices; 32 mod events; 33 mod ffi; 34 mod grpc_server; 35 mod http_server; 36 mod ranging; 37 mod resource; 38 mod rust_main; 39 mod service; 40 mod session; 41 mod transport; 42 mod uwb; 43 mod version; 44 mod wifi; 45 mod wireless; 46 47 // This feature is enabled only for CMake builds 48 #[cfg(feature = "local_ssl")] 49 mod openssl; 50