diff --git a/veilid-core/src/intf/wasm/protected_store.rs b/veilid-core/src/intf/wasm/protected_store.rs index 5303e6f0..d99e79a2 100644 --- a/veilid-core/src/intf/wasm/protected_store.rs +++ b/veilid-core/src/intf/wasm/protected_store.rs @@ -1,5 +1,7 @@ use super::utils; use crate::xx::*; +use crate::*; +use data_encoding::BASE64URL_NOPAD; use js_sys::*; use wasm_bindgen_futures::*; use web_sys::*; @@ -14,172 +16,246 @@ extern "C" { fn keytar_deletePassword(service: &str, account: &str) -> Result; } -fn keyring_name(namespace: &str) -> String { - if namespace.len() == 0 { - "veilid".to_owned() - } else { - format!("veilid_{}", namespace) - } + +#[derive(Clone)] +pub struct ProtectedStore { + config: VeilidConfig, } -fn browser_key_name(namespace: &str, key: &str) -> String { - if namespace.len() == 0 { - format!("__veilid_secret_{}", key) - } else { - format!("__veilid_{}_secret_{}", namespace, key) - } -} +impl ProtectedStore { -pub async fn save_user_secret_string( - namespace: &str, - key: &str, - value: &str, -) -> Result { - if utils::is_nodejs() { - let prev = match JsFuture::from( - keytar_getPassword(keyring_name(namespace).as_str(), key) - .map_err(|_| "exception thrown".to_owned())?, - ) - .await - { - Ok(v) => v.is_truthy(), - Err(_) => false, + pub fn new(config: VeilidConfig) -> Self { + Self { + config, + } + } + + pub async fn delete_all(&self) -> Result<(), String> { + // Delete all known keys + if self.remove_user_secret_string("node_id").await? { + debug!("deleted protected_store key 'node_id'"); + } + if self.remove_user_secret_string("node_id_secret").await? { + debug!("deleted protected_store key 'node_id_secret'"); + } + if self.remove_user_secret_string("_test_key").await? { + debug!("deleted protected_store key '_test_key'"); + } + Ok(()) + } + + pub async fn init(&self) -> Result<(), String> { + Ok(()) + } + + pub async fn terminate(&self) {} + + fn keyring_name(&self) -> String { + let c = self.config.get(); + if c.namespace.is_empty() { + "veilid_protected_store".to_owned() + } else { + format!("veilid_protected_store_{}", c.namespace) + } + } + + fn browser_key_name(&self, key: &str) -> String { + let c = self.config.get(); + if c.namespace.is_empty() { + format!("__veilid_protected_store_{}", key) + } else { + format!("__veilid_protected_store_{}_{}", c.namespace, key) + } + } + + pub async fn save_user_secret_string(&self, key: &str, value: &str) -> Result { + if utils::is_nodejs() { + let prev = match JsFuture::from( + keytar_getPassword(self.keyring_name().as_str(), key) + .map_err(|_| "exception thrown".to_owned())?, + ) + .await + { + Ok(v) => v.is_truthy(), + Err(_) => false, + }; + + match JsFuture::from( + keytar_setPassword(self.keyring_name().as_str(), key, value) + .map_err(|_| "exception thrown".to_owned())?, + ) + .await + { + Ok(_) => {} + Err(_) => return Err("Failed to set password".to_owned()), + } + + Ok(prev) + } else if utils::is_browser() { + let win = match window() { + Some(w) => w, + None => { + return Err("failed to get window".to_owned()); + } + }; + + let ls = match win + .local_storage() + .map_err(|_| "exception getting local storage".to_owned())? + { + Some(l) => l, + None => { + return Err("failed to get local storage".to_owned()); + } + }; + + let vkey = self.browser_key_name(key); + + let prev = match ls + .get_item(&vkey) + .map_err(|_| "exception_thrown".to_owned())? + { + Some(_) => true, + None => false, + }; + + ls.set_item(&vkey, value) + .map_err(|_| "exception_thrown".to_owned())?; + + Ok(prev) + } else { + Err("unimplemented".to_owned()) + } + } + + pub async fn load_user_secret_string(&self, key: &str) -> Result, String> { + if utils::is_nodejs() { + let prev = match JsFuture::from( + keytar_getPassword(self.keyring_name().as_str(), key) + .map_err(|_| "exception thrown".to_owned())?, + ) + .await + { + Ok(p) => p, + Err(_) => JsValue::UNDEFINED, + }; + + if prev.is_undefined() || prev.is_null() { + return Ok(None); + } + + Ok(prev.as_string()) + } else if utils::is_browser() { + let win = match window() { + Some(w) => w, + None => { + return Err("failed to get window".to_owned()); + } + }; + + let ls = match win + .local_storage() + .map_err(|_| "exception getting local storage".to_owned())? + { + Some(l) => l, + None => { + return Err("failed to get local storage".to_owned()); + } + }; + + let vkey = self.browser_key_name(key); + + ls.get_item(&vkey) + .map_err(|_| "exception_thrown".to_owned()) + } else { + Err("unimplemented".to_owned()) + } + } + + pub async fn remove_user_secret_string(&self, key: &str) -> Result { + if utils::is_nodejs() { + match JsFuture::from( + keytar_deletePassword(self.keyring_name().as_str(), key).map_err(|_| "exception thrown".to_owned())?, + ) + .await + { + Ok(v) => Ok(v.is_truthy()), + Err(_) => Err("Failed to delete".to_owned()), + } + } else if utils::is_browser() { + let win = match window() { + Some(w) => w, + None => { + return Err("failed to get window".to_owned()); + } + }; + + let ls = match win + .local_storage() + .map_err(|_| "exception getting local storage".to_owned())? + { + Some(l) => l, + None => { + return Err("failed to get local storage".to_owned()); + } + }; + + let vkey = self.browser_key_name(key); + + match ls + .get_item(&vkey) + .map_err(|_| "exception_thrown".to_owned())? + { + Some(_) => { + ls.delete(&vkey) + .map_err(|_| "exception_thrown".to_owned())?; + Ok(true) + } + None => Ok(false), + } + } else { + Err("unimplemented".to_owned()) + } + } + + pub async fn save_user_secret(&self, key: &str, value: &[u8]) -> Result { + let mut s = BASE64URL_NOPAD.encode(value); + s.push('!'); + + self.save_user_secret_string(key, s.as_str()).await + } + + pub async fn load_user_secret(&self, key: &str) -> Result>, String> { + let mut s = match self.load_user_secret_string(key).await? { + Some(s) => s, + None => { + return Ok(None); + } }; - match JsFuture::from( - keytar_setPassword(keyring_name(namespace).as_str(), key, value) - .map_err(|_| "exception thrown".to_owned())?, - ) - .await - { - Ok(_) => {} - Err(_) => return Err("Failed to set password".to_owned()), + if s.pop() != Some('!') { + return Err("User secret is not a buffer".to_owned()); } - Ok(prev) - } else if utils::is_browser() { - let win = match window() { - Some(w) => w, - None => { - return Err("failed to get window".to_owned()); + let mut bytes = Vec::::new(); + let res = BASE64URL_NOPAD.decode_len(s.len()); + match res { + Ok(l) => { + bytes.resize(l, 0u8); } - }; - - let ls = match win - .local_storage() - .map_err(|_| "exception getting local storage".to_owned())? - { - Some(l) => l, - None => { - return Err("failed to get local storage".to_owned()); + Err(_) => { + return Err("Failed to decode".to_owned()); } - }; - - let vkey = browser_key_name(namespace, key); - - let prev = match ls - .get_item(&vkey) - .map_err(|_| "exception_thrown".to_owned())? - { - Some(_) => true, - None => false, - }; - - ls.set_item(&vkey, value) - .map_err(|_| "exception_thrown".to_owned())?; - - Ok(prev) - } else { - Err("unimplemented".to_owned()) - } -} - -pub async fn load_user_secret_string(namespace: &str, key: &str) -> Result, String> { - if utils::is_nodejs() { - let prev = match JsFuture::from( - keytar_getPassword(keyring_name(namespace).as_str(), key) - .map_err(|_| "exception thrown".to_owned())?, - ) - .await - { - Ok(p) => p, - Err(_) => JsValue::UNDEFINED, - }; - - if prev.is_undefined() || prev.is_null() { - return Ok(None); } - Ok(prev.as_string()) - } else if utils::is_browser() { - let win = match window() { - Some(w) => w, - None => { - return Err("failed to get window".to_owned()); - } - }; - - let ls = match win - .local_storage() - .map_err(|_| "exception getting local storage".to_owned())? - { - Some(l) => l, - None => { - return Err("failed to get local storage".to_owned()); - } - }; - - let vkey = browser_key_name(namespace, key); - - ls.get_item(&vkey) - .map_err(|_| "exception_thrown".to_owned()) - } else { - Err("unimplemented".to_owned()) - } -} - -pub async fn remove_user_secret_string(namespace: &str, key: &str) -> Result { - if utils::is_nodejs() { - match JsFuture::from( - keytar_deletePassword("veilid", key).map_err(|_| "exception thrown".to_owned())?, - ) - .await - { - Ok(v) => Ok(v.is_truthy()), - Err(_) => Err("Failed to delete".to_owned()), + let res = BASE64URL_NOPAD.decode_mut(s.as_bytes(), &mut bytes); + match res { + Ok(_) => Ok(Some(bytes)), + Err(_) => Err("Failed to decode".to_owned()), } - } else if utils::is_browser() { - let win = match window() { - Some(w) => w, - None => { - return Err("failed to get window".to_owned()); - } - }; - - let ls = match win - .local_storage() - .map_err(|_| "exception getting local storage".to_owned())? - { - Some(l) => l, - None => { - return Err("failed to get local storage".to_owned()); - } - }; - - let vkey = browser_key_name(namespace, key); - - match ls - .get_item(&vkey) - .map_err(|_| "exception_thrown".to_owned())? - { - Some(_) => { - ls.delete(&vkey) - .map_err(|_| "exception_thrown".to_owned())?; - Ok(true) - } - None => Ok(false), - } - } else { - Err("unimplemented".to_owned()) } -} + + pub async fn remove_user_secret(&self, key: &str) -> Result { + self.remove_user_secret_string(key).await + } +} \ No newline at end of file diff --git a/veilid-core/src/intf/wasm/table_store.rs b/veilid-core/src/intf/wasm/table_store.rs index e0f7fe95..726b0203 100644 --- a/veilid-core/src/intf/wasm/table_store.rs +++ b/veilid-core/src/intf/wasm/table_store.rs @@ -54,7 +54,7 @@ impl TableStore { { return Err(format!("table name '{}' is invalid", table)); } - let c = inner.config.get(); + let c = self.config.get(); let namespace = c.namespace.clone(); Ok(if namespace.len() == 0 { format!("{}", table) diff --git a/veilid-core/src/tests/common/test_veilid_config.rs b/veilid-core/src/tests/common/test_veilid_config.rs index c377c3b7..4d78e133 100644 --- a/veilid-core/src/tests/common/test_veilid_config.rs +++ b/veilid-core/src/tests/common/test_veilid_config.rs @@ -64,7 +64,13 @@ wFAbkZY9eS/x6P7qrpd7dUA= cfg_if! { if #[cfg(target_arch = "wasm32")] { - pub fn get_tablestore_path() -> String { + pub fn get_table_store_path() -> String { + String::new() + } + pub fn get_block_store_path() -> String { + String::new() + } + pub fn get_protected_store_path() -> String { String::new() } pub fn get_certfile_path() -> String { @@ -103,6 +109,15 @@ cfg_if! { out.into_os_string().into_string().unwrap() } + pub fn get_block_store_path() -> String { + let mut out = get_data_dir(); + std::fs::create_dir_all(&out).unwrap(); + + out.push("block_store"); + + out.into_os_string().into_string().unwrap() + } + pub fn get_protected_store_path() -> String { let mut out = get_data_dir(); std::fs::create_dir_all(&out).unwrap(); @@ -156,7 +171,7 @@ pub fn setup_veilid_core() -> VeilidCoreSetup { } } -pub fn config_callback(key: String) -> Result, String> { +pub fn config_callback(key: String) -> ConfigCallbackReturn { match key.as_str() { "program_name" => Ok(Box::new(String::from("Veilid"))), "namespace" => Ok(Box::new(String::from(""))), @@ -168,9 +183,13 @@ pub fn config_callback(key: String) -> Result, String> { "capabilities.protocol_connect_wss" => Ok(Box::new(true)), "capabilities.protocol_accept_wss" => Ok(Box::new(true)), "table_store.directory" => Ok(Box::new(get_table_store_path())), + "table_store.delete" => Ok(Box::new(false)), + "block_store.directory" => Ok(Box::new(get_block_store_path())), + "block_store.delete" => Ok(Box::new(false)), "protected_store.allow_insecure_fallback" => Ok(Box::new(true)), "protected_store.always_use_insecure_storage" => Ok(Box::new(false)), "protected_store.insecure_fallback_directory" => Ok(Box::new(get_protected_store_path())), + "protected_store.delete" => Ok(Box::new(false)), "network.max_connections" => Ok(Box::new(16u32)), "network.connection_initial_timeout" => Ok(Box::new(2_000_000u64)), "network.node_id" => Ok(Box::new(dht::key::DHTKey::default())), @@ -264,12 +283,16 @@ pub async fn test_config() { assert_eq!(inner.capabilities.protocol_connect_wss, true); assert_eq!(inner.capabilities.protocol_accept_wss, true); assert_eq!(inner.table_store.directory, get_table_store_path()); + assert_eq!(inner.table_store.delete, false); + assert_eq!(inner.block_store.directory, get_block_store_path()); + assert_eq!(inner.block_store.delete, false); assert_eq!(inner.protected_store.allow_insecure_fallback, true); assert_eq!(inner.protected_store.always_use_insecure_storage, false); assert_eq!( inner.protected_store.insecure_fallback_directory, get_protected_store_path() ); + assert_eq!(inner.protected_store.delete, false); assert_eq!(inner.network.max_connections, 16); assert_eq!(inner.network.connection_initial_timeout, 2_000_000u64); assert!(!inner.network.node_id.valid); diff --git a/veilid-core/src/veilid_config.rs b/veilid-core/src/veilid_config.rs index 6ba94c56..9474398e 100644 --- a/veilid-core/src/veilid_config.rs +++ b/veilid-core/src/veilid_config.rs @@ -4,9 +4,12 @@ use crate::xx::*; cfg_if! { if #[cfg(target_arch = "wasm32")] { - pub type ConfigCallback = Arc Result, String>>; + pub type ConfigCallbackReturn = Result, String>; + pub type ConfigCallback = Arc ConfigCallbackReturn>; + } else { - pub type ConfigCallback = Arc Result, String> + Send>; + pub type ConfigCallbackReturn = Result, String>; + pub type ConfigCallback = Arc ConfigCallbackReturn + Send>; } } diff --git a/veilid-flutter/lib/bridge_generated.dart b/veilid-flutter/lib/bridge_generated.dart new file mode 100644 index 00000000..83bf7627 --- /dev/null +++ b/veilid-flutter/lib/bridge_generated.dart @@ -0,0 +1,982 @@ +// AUTO GENERATED FILE, DO NOT EDIT. +// Generated by `flutter_rust_bridge`. + +// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import + +import 'dart:convert'; +import 'dart:typed_data'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +import 'dart:convert'; +import 'dart:typed_data'; +import 'package:flutter_rust_bridge/flutter_rust_bridge.dart'; +import 'dart:ffi' as ffi; + +part 'bridge_generated.freezed.dart'; + +abstract class VeilidFlutter { + Stream startupVeilidCore( + {required VeilidConfig config, dynamic hint}); + + Future getVeilidState({dynamic hint}); + + Future shutdownVeilidCore({dynamic hint}); +} + +enum AttachmentState { + Detached, + Attaching, + AttachedWeak, + AttachedGood, + AttachedStrong, + FullyAttached, + OverAttached, + Detaching, +} + +class VeilidConfig { + final String programName; + final String namespace; + final VeilidConfigCapabilities capabilities; + final VeilidConfigProtectedStore protectedStore; + final VeilidConfigTableStore tableStore; + final VeilidConfigBlockStore blockStore; + final VeilidConfigNetwork network; + + VeilidConfig({ + required this.programName, + required this.namespace, + required this.capabilities, + required this.protectedStore, + required this.tableStore, + required this.blockStore, + required this.network, + }); +} + +class VeilidConfigBlockStore { + final String directory; + final bool delete; + + VeilidConfigBlockStore({ + required this.directory, + required this.delete, + }); +} + +class VeilidConfigCapabilities { + final bool protocolUdp; + final bool protocolConnectTcp; + final bool protocolAcceptTcp; + final bool protocolConnectWs; + final bool protocolAcceptWs; + final bool protocolConnectWss; + final bool protocolAcceptWss; + + VeilidConfigCapabilities({ + required this.protocolUdp, + required this.protocolConnectTcp, + required this.protocolAcceptTcp, + required this.protocolConnectWs, + required this.protocolAcceptWs, + required this.protocolConnectWss, + required this.protocolAcceptWss, + }); +} + +class VeilidConfigDHT { + final int? resolveNodeTimeout; + final int resolveNodeCount; + final int resolveNodeFanout; + final int maxFindNodeCount; + final int? getValueTimeout; + final int getValueCount; + final int getValueFanout; + final int? setValueTimeout; + final int setValueCount; + final int setValueFanout; + final int minPeerCount; + final int minPeerRefreshTime; + final int validateDialInfoReceiptTime; + + VeilidConfigDHT({ + this.resolveNodeTimeout, + required this.resolveNodeCount, + required this.resolveNodeFanout, + required this.maxFindNodeCount, + this.getValueTimeout, + required this.getValueCount, + required this.getValueFanout, + this.setValueTimeout, + required this.setValueCount, + required this.setValueFanout, + required this.minPeerCount, + required this.minPeerRefreshTime, + required this.validateDialInfoReceiptTime, + }); +} + +class VeilidConfigLeases { + final int maxServerSignalLeases; + final int maxServerRelayLeases; + final int maxClientSignalLeases; + final int maxClientRelayLeases; + + VeilidConfigLeases({ + required this.maxServerSignalLeases, + required this.maxServerRelayLeases, + required this.maxClientSignalLeases, + required this.maxClientRelayLeases, + }); +} + +class VeilidConfigNetwork { + final int maxConnections; + final int connectionInitialTimeout; + final String nodeId; + final String nodeIdSecret; + final List bootstrap; + final VeilidConfigRPC rpc; + final VeilidConfigDHT dht; + final bool upnp; + final bool natpmp; + final bool enableLocalPeerScope; + final int restrictedNatRetries; + final VeilidConfigProtocol protocol; + final VeilidConfigLeases leases; + + VeilidConfigNetwork({ + required this.maxConnections, + required this.connectionInitialTimeout, + required this.nodeId, + required this.nodeIdSecret, + required this.bootstrap, + required this.rpc, + required this.dht, + required this.upnp, + required this.natpmp, + required this.enableLocalPeerScope, + required this.restrictedNatRetries, + required this.protocol, + required this.leases, + }); +} + +class VeilidConfigProtectedStore { + final bool allowInsecureFallback; + final bool alwaysUseInsecureStorage; + final String insecureFallbackDirectory; + final bool delete; + + VeilidConfigProtectedStore({ + required this.allowInsecureFallback, + required this.alwaysUseInsecureStorage, + required this.insecureFallbackDirectory, + required this.delete, + }); +} + +class VeilidConfigProtocol { + final VeilidConfigUDP udp; + final VeilidConfigTCP tcp; + final VeilidConfigWS ws; + final VeilidConfigWSS wss; + + VeilidConfigProtocol({ + required this.udp, + required this.tcp, + required this.ws, + required this.wss, + }); +} + +class VeilidConfigRPC { + final int concurrency; + final int queueSize; + final int? maxTimestampBehind; + final int? maxTimestampAhead; + final int timeout; + final int maxRouteHopCount; + + VeilidConfigRPC({ + required this.concurrency, + required this.queueSize, + this.maxTimestampBehind, + this.maxTimestampAhead, + required this.timeout, + required this.maxRouteHopCount, + }); +} + +class VeilidConfigTableStore { + final String directory; + final bool delete; + + VeilidConfigTableStore({ + required this.directory, + required this.delete, + }); +} + +class VeilidConfigTCP { + final bool connect; + final bool listen; + final int maxConnections; + final String listenAddress; + final String? publicAddress; + + VeilidConfigTCP({ + required this.connect, + required this.listen, + required this.maxConnections, + required this.listenAddress, + this.publicAddress, + }); +} + +class VeilidConfigUDP { + final bool enabled; + final int socketPoolSize; + final String listenAddress; + final String? publicAddress; + + VeilidConfigUDP({ + required this.enabled, + required this.socketPoolSize, + required this.listenAddress, + this.publicAddress, + }); +} + +class VeilidConfigWS { + final bool connect; + final bool listen; + final int maxConnections; + final String listenAddress; + final String path; + final String? url; + + VeilidConfigWS({ + required this.connect, + required this.listen, + required this.maxConnections, + required this.listenAddress, + required this.path, + this.url, + }); +} + +class VeilidConfigWSS { + final bool connect; + final int maxConnections; + + VeilidConfigWSS({ + required this.connect, + required this.maxConnections, + }); +} + +class VeilidState { + final AttachmentState attachment; + + VeilidState({ + required this.attachment, + }); +} + +@freezed +class VeilidUpdate with _$VeilidUpdate { + const factory VeilidUpdate.attachment( + AttachmentState field0, + ) = Attachment; +} + +class VeilidFlutterImpl extends FlutterRustBridgeBase + implements VeilidFlutter { + factory VeilidFlutterImpl(ffi.DynamicLibrary dylib) => + VeilidFlutterImpl.raw(VeilidFlutterWire(dylib)); + + VeilidFlutterImpl.raw(VeilidFlutterWire inner) : super(inner); + + Stream startupVeilidCore( + {required VeilidConfig config, dynamic hint}) => + executeStream(FlutterRustBridgeTask( + callFfi: (port) => inner.wire_startup_veilid_core( + port, _api2wire_box_autoadd_veilid_config(config)), + parseSuccessData: _wire2api_veilid_update, + constMeta: const FlutterRustBridgeTaskConstMeta( + debugName: "startup_veilid_core", + argNames: ["config"], + ), + argValues: [config], + hint: hint, + )); + + Future getVeilidState({dynamic hint}) => + executeNormal(FlutterRustBridgeTask( + callFfi: (port) => inner.wire_get_veilid_state(port), + parseSuccessData: _wire2api_veilid_state, + constMeta: const FlutterRustBridgeTaskConstMeta( + debugName: "get_veilid_state", + argNames: [], + ), + argValues: [], + hint: hint, + )); + + Future shutdownVeilidCore({dynamic hint}) => + executeNormal(FlutterRustBridgeTask( + callFfi: (port) => inner.wire_shutdown_veilid_core(port), + parseSuccessData: _wire2api_unit, + constMeta: const FlutterRustBridgeTaskConstMeta( + debugName: "shutdown_veilid_core", + argNames: [], + ), + argValues: [], + hint: hint, + )); + + // Section: api2wire + ffi.Pointer _api2wire_String(String raw) { + return _api2wire_uint_8_list(utf8.encoder.convert(raw)); + } + + ffi.Pointer _api2wire_StringList(List raw) { + final ans = inner.new_StringList(raw.length); + for (var i = 0; i < raw.length; i++) { + ans.ref.ptr[i] = _api2wire_String(raw[i]); + } + return ans; + } + + int _api2wire_bool(bool raw) { + return raw ? 1 : 0; + } + + ffi.Pointer _api2wire_box_autoadd_u64(int raw) { + return inner.new_box_autoadd_u64(raw); + } + + ffi.Pointer _api2wire_box_autoadd_veilid_config( + VeilidConfig raw) { + final ptr = inner.new_box_autoadd_veilid_config(); + _api_fill_to_wire_veilid_config(raw, ptr.ref); + return ptr; + } + + ffi.Pointer _api2wire_opt_String(String? raw) { + return raw == null ? ffi.nullptr : _api2wire_String(raw); + } + + ffi.Pointer _api2wire_opt_box_autoadd_u64(int? raw) { + return raw == null ? ffi.nullptr : _api2wire_box_autoadd_u64(raw); + } + + int _api2wire_u32(int raw) { + return raw; + } + + int _api2wire_u64(int raw) { + return raw; + } + + int _api2wire_u8(int raw) { + return raw; + } + + ffi.Pointer _api2wire_uint_8_list(Uint8List raw) { + final ans = inner.new_uint_8_list(raw.length); + ans.ref.ptr.asTypedList(raw.length).setAll(0, raw); + return ans; + } + + // Section: api_fill_to_wire + + void _api_fill_to_wire_box_autoadd_veilid_config( + VeilidConfig apiObj, ffi.Pointer wireObj) { + _api_fill_to_wire_veilid_config(apiObj, wireObj.ref); + } + + void _api_fill_to_wire_veilid_config( + VeilidConfig apiObj, wire_VeilidConfig wireObj) { + wireObj.program_name = _api2wire_String(apiObj.programName); + wireObj.namespace = _api2wire_String(apiObj.namespace); + wireObj.capabilities = + _api2wire_veilid_config_capabilities(apiObj.capabilities); + wireObj.protected_store = + _api2wire_veilid_config_protected_store(apiObj.protectedStore); + wireObj.table_store = + _api2wire_veilid_config_table_store(apiObj.tableStore); + wireObj.block_store = + _api2wire_veilid_config_block_store(apiObj.blockStore); + wireObj.network = _api2wire_veilid_config_network(apiObj.network); + } + + void _api_fill_to_wire_veilid_config_block_store( + VeilidConfigBlockStore apiObj, wire_VeilidConfigBlockStore wireObj) { + wireObj.directory = _api2wire_String(apiObj.directory); + wireObj.delete = _api2wire_bool(apiObj.delete); + } + + void _api_fill_to_wire_veilid_config_capabilities( + VeilidConfigCapabilities apiObj, wire_VeilidConfigCapabilities wireObj) { + wireObj.protocol_udp = _api2wire_bool(apiObj.protocolUdp); + wireObj.protocol_connect_tcp = _api2wire_bool(apiObj.protocolConnectTcp); + wireObj.protocol_accept_tcp = _api2wire_bool(apiObj.protocolAcceptTcp); + wireObj.protocol_connect_ws = _api2wire_bool(apiObj.protocolConnectWs); + wireObj.protocol_accept_ws = _api2wire_bool(apiObj.protocolAcceptWs); + wireObj.protocol_connect_wss = _api2wire_bool(apiObj.protocolConnectWss); + wireObj.protocol_accept_wss = _api2wire_bool(apiObj.protocolAcceptWss); + } + + void _api_fill_to_wire_veilid_config_dht( + VeilidConfigDHT apiObj, wire_VeilidConfigDHT wireObj) { + wireObj.resolve_node_timeout = + _api2wire_opt_box_autoadd_u64(apiObj.resolveNodeTimeout); + wireObj.resolve_node_count = _api2wire_u32(apiObj.resolveNodeCount); + wireObj.resolve_node_fanout = _api2wire_u32(apiObj.resolveNodeFanout); + wireObj.max_find_node_count = _api2wire_u32(apiObj.maxFindNodeCount); + wireObj.get_value_timeout = + _api2wire_opt_box_autoadd_u64(apiObj.getValueTimeout); + wireObj.get_value_count = _api2wire_u32(apiObj.getValueCount); + wireObj.get_value_fanout = _api2wire_u32(apiObj.getValueFanout); + wireObj.set_value_timeout = + _api2wire_opt_box_autoadd_u64(apiObj.setValueTimeout); + wireObj.set_value_count = _api2wire_u32(apiObj.setValueCount); + wireObj.set_value_fanout = _api2wire_u32(apiObj.setValueFanout); + wireObj.min_peer_count = _api2wire_u32(apiObj.minPeerCount); + wireObj.min_peer_refresh_time = _api2wire_u64(apiObj.minPeerRefreshTime); + wireObj.validate_dial_info_receipt_time = + _api2wire_u64(apiObj.validateDialInfoReceiptTime); + } + + void _api_fill_to_wire_veilid_config_leases( + VeilidConfigLeases apiObj, wire_VeilidConfigLeases wireObj) { + wireObj.max_server_signal_leases = + _api2wire_u32(apiObj.maxServerSignalLeases); + wireObj.max_server_relay_leases = + _api2wire_u32(apiObj.maxServerRelayLeases); + wireObj.max_client_signal_leases = + _api2wire_u32(apiObj.maxClientSignalLeases); + wireObj.max_client_relay_leases = + _api2wire_u32(apiObj.maxClientRelayLeases); + } + + void _api_fill_to_wire_veilid_config_network( + VeilidConfigNetwork apiObj, wire_VeilidConfigNetwork wireObj) { + wireObj.max_connections = _api2wire_u32(apiObj.maxConnections); + wireObj.connection_initial_timeout = + _api2wire_u64(apiObj.connectionInitialTimeout); + wireObj.node_id = _api2wire_String(apiObj.nodeId); + wireObj.node_id_secret = _api2wire_String(apiObj.nodeIdSecret); + wireObj.bootstrap = _api2wire_StringList(apiObj.bootstrap); + wireObj.rpc = _api2wire_veilid_config_rpc(apiObj.rpc); + wireObj.dht = _api2wire_veilid_config_dht(apiObj.dht); + wireObj.upnp = _api2wire_bool(apiObj.upnp); + wireObj.natpmp = _api2wire_bool(apiObj.natpmp); + wireObj.enable_local_peer_scope = + _api2wire_bool(apiObj.enableLocalPeerScope); + wireObj.restricted_nat_retries = _api2wire_u32(apiObj.restrictedNatRetries); + wireObj.protocol = _api2wire_veilid_config_protocol(apiObj.protocol); + wireObj.leases = _api2wire_veilid_config_leases(apiObj.leases); + } + + void _api_fill_to_wire_veilid_config_protected_store( + VeilidConfigProtectedStore apiObj, + wire_VeilidConfigProtectedStore wireObj) { + wireObj.allow_insecure_fallback = + _api2wire_bool(apiObj.allowInsecureFallback); + wireObj.always_use_insecure_storage = + _api2wire_bool(apiObj.alwaysUseInsecureStorage); + wireObj.insecure_fallback_directory = + _api2wire_String(apiObj.insecureFallbackDirectory); + wireObj.delete = _api2wire_bool(apiObj.delete); + } + + void _api_fill_to_wire_veilid_config_protocol( + VeilidConfigProtocol apiObj, wire_VeilidConfigProtocol wireObj) { + wireObj.udp = _api2wire_veilid_config_udp(apiObj.udp); + wireObj.tcp = _api2wire_veilid_config_tcp(apiObj.tcp); + wireObj.ws = _api2wire_veilid_config_ws(apiObj.ws); + wireObj.wss = _api2wire_veilid_config_wss(apiObj.wss); + } + + void _api_fill_to_wire_veilid_config_rpc( + VeilidConfigRPC apiObj, wire_VeilidConfigRPC wireObj) { + wireObj.concurrency = _api2wire_u32(apiObj.concurrency); + wireObj.queue_size = _api2wire_u32(apiObj.queueSize); + wireObj.max_timestamp_behind = + _api2wire_opt_box_autoadd_u64(apiObj.maxTimestampBehind); + wireObj.max_timestamp_ahead = + _api2wire_opt_box_autoadd_u64(apiObj.maxTimestampAhead); + wireObj.timeout = _api2wire_u64(apiObj.timeout); + wireObj.max_route_hop_count = _api2wire_u8(apiObj.maxRouteHopCount); + } + + void _api_fill_to_wire_veilid_config_table_store( + VeilidConfigTableStore apiObj, wire_VeilidConfigTableStore wireObj) { + wireObj.directory = _api2wire_String(apiObj.directory); + wireObj.delete = _api2wire_bool(apiObj.delete); + } + + void _api_fill_to_wire_veilid_config_tcp( + VeilidConfigTCP apiObj, wire_VeilidConfigTCP wireObj) { + wireObj.connect = _api2wire_bool(apiObj.connect); + wireObj.listen = _api2wire_bool(apiObj.listen); + wireObj.max_connections = _api2wire_u32(apiObj.maxConnections); + wireObj.listen_address = _api2wire_String(apiObj.listenAddress); + wireObj.public_address = _api2wire_opt_String(apiObj.publicAddress); + } + + void _api_fill_to_wire_veilid_config_udp( + VeilidConfigUDP apiObj, wire_VeilidConfigUDP wireObj) { + wireObj.enabled = _api2wire_bool(apiObj.enabled); + wireObj.socket_pool_size = _api2wire_u32(apiObj.socketPoolSize); + wireObj.listen_address = _api2wire_String(apiObj.listenAddress); + wireObj.public_address = _api2wire_opt_String(apiObj.publicAddress); + } + + void _api_fill_to_wire_veilid_config_ws( + VeilidConfigWS apiObj, wire_VeilidConfigWS wireObj) { + wireObj.connect = _api2wire_bool(apiObj.connect); + wireObj.listen = _api2wire_bool(apiObj.listen); + wireObj.max_connections = _api2wire_u32(apiObj.maxConnections); + wireObj.listen_address = _api2wire_String(apiObj.listenAddress); + wireObj.path = _api2wire_String(apiObj.path); + wireObj.url = _api2wire_opt_String(apiObj.url); + } + + void _api_fill_to_wire_veilid_config_wss( + VeilidConfigWSS apiObj, wire_VeilidConfigWSS wireObj) { + wireObj.connect = _api2wire_bool(apiObj.connect); + wireObj.max_connections = _api2wire_u32(apiObj.maxConnections); + } +} + +// Section: wire2api +AttachmentState _wire2api_attachment_state(dynamic raw) { + return AttachmentState.values[raw]; +} + +void _wire2api_unit(dynamic raw) { + return; +} + +VeilidState _wire2api_veilid_state(dynamic raw) { + final arr = raw as List; + if (arr.length != 1) + throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return VeilidState( + attachment: _wire2api_attachment_state(arr[0]), + ); +} + +VeilidUpdate _wire2api_veilid_update(dynamic raw) { + switch (raw[0]) { + case 0: + return Attachment( + _wire2api_attachment_state(raw[1]), + ); + default: + throw Exception("unreachable"); + } +} + +// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names + +// AUTO GENERATED FILE, DO NOT EDIT. +// +// Generated by `package:ffigen`. + +/// generated by flutter_rust_bridge +class VeilidFlutterWire implements FlutterRustBridgeWireBase { + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + VeilidFlutterWire(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; + + /// The symbols are looked up with [lookup]. + VeilidFlutterWire.fromLookup( + ffi.Pointer Function(String symbolName) + lookup) + : _lookup = lookup; + + void wire_startup_veilid_core( + int port_, + ffi.Pointer config, + ) { + return _wire_startup_veilid_core( + port_, + config, + ); + } + + late final _wire_startup_veilid_corePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, + ffi.Pointer)>>('wire_startup_veilid_core'); + late final _wire_startup_veilid_core = _wire_startup_veilid_corePtr + .asFunction)>(); + + void wire_get_veilid_state( + int port_, + ) { + return _wire_get_veilid_state( + port_, + ); + } + + late final _wire_get_veilid_statePtr = + _lookup>( + 'wire_get_veilid_state'); + late final _wire_get_veilid_state = + _wire_get_veilid_statePtr.asFunction(); + + void wire_shutdown_veilid_core( + int port_, + ) { + return _wire_shutdown_veilid_core( + port_, + ); + } + + late final _wire_shutdown_veilid_corePtr = + _lookup>( + 'wire_shutdown_veilid_core'); + late final _wire_shutdown_veilid_core = + _wire_shutdown_veilid_corePtr.asFunction(); + + ffi.Pointer new_StringList( + int len, + ) { + return _new_StringList( + len, + ); + } + + late final _new_StringListPtr = _lookup< + ffi.NativeFunction Function(ffi.Int32)>>( + 'new_StringList'); + late final _new_StringList = _new_StringListPtr + .asFunction Function(int)>(); + + ffi.Pointer new_box_autoadd_u64( + int value, + ) { + return _new_box_autoadd_u64( + value, + ); + } + + late final _new_box_autoadd_u64Ptr = + _lookup Function(ffi.Uint64)>>( + 'new_box_autoadd_u64'); + late final _new_box_autoadd_u64 = _new_box_autoadd_u64Ptr + .asFunction Function(int)>(); + + ffi.Pointer new_box_autoadd_veilid_config() { + return _new_box_autoadd_veilid_config(); + } + + late final _new_box_autoadd_veilid_configPtr = + _lookup Function()>>( + 'new_box_autoadd_veilid_config'); + late final _new_box_autoadd_veilid_config = _new_box_autoadd_veilid_configPtr + .asFunction Function()>(); + + ffi.Pointer new_uint_8_list( + int len, + ) { + return _new_uint_8_list( + len, + ); + } + + late final _new_uint_8_listPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int32)>>('new_uint_8_list'); + late final _new_uint_8_list = _new_uint_8_listPtr + .asFunction Function(int)>(); + + void free_WireSyncReturnStruct( + WireSyncReturnStruct val, + ) { + return _free_WireSyncReturnStruct( + val, + ); + } + + late final _free_WireSyncReturnStructPtr = + _lookup>( + 'free_WireSyncReturnStruct'); + late final _free_WireSyncReturnStruct = _free_WireSyncReturnStructPtr + .asFunction(); + + void store_dart_post_cobject( + DartPostCObjectFnType ptr, + ) { + return _store_dart_post_cobject( + ptr, + ); + } + + late final _store_dart_post_cobjectPtr = + _lookup>( + 'store_dart_post_cobject'); + late final _store_dart_post_cobject = _store_dart_post_cobjectPtr + .asFunction(); +} + +class wire_uint_8_list extends ffi.Struct { + external ffi.Pointer ptr; + + @ffi.Int32() + external int len; +} + +class wire_VeilidConfigCapabilities extends ffi.Struct { + @ffi.Uint8() + external int protocol_udp; + + @ffi.Uint8() + external int protocol_connect_tcp; + + @ffi.Uint8() + external int protocol_accept_tcp; + + @ffi.Uint8() + external int protocol_connect_ws; + + @ffi.Uint8() + external int protocol_accept_ws; + + @ffi.Uint8() + external int protocol_connect_wss; + + @ffi.Uint8() + external int protocol_accept_wss; +} + +class wire_VeilidConfigProtectedStore extends ffi.Struct { + @ffi.Uint8() + external int allow_insecure_fallback; + + @ffi.Uint8() + external int always_use_insecure_storage; + + external ffi.Pointer insecure_fallback_directory; + + @ffi.Uint8() + external int delete_; +} + +class wire_VeilidConfigTableStore extends ffi.Struct { + external ffi.Pointer directory; + + @ffi.Uint8() + external int delete_; +} + +class wire_VeilidConfigBlockStore extends ffi.Struct { + external ffi.Pointer directory; + + @ffi.Uint8() + external int delete_; +} + +class wire_StringList extends ffi.Struct { + external ffi.Pointer> ptr; + + @ffi.Int32() + external int len; +} + +class wire_VeilidConfigRPC extends ffi.Struct { + @ffi.Uint32() + external int concurrency; + + @ffi.Uint32() + external int queue_size; + + external ffi.Pointer max_timestamp_behind; + + external ffi.Pointer max_timestamp_ahead; + + @ffi.Uint64() + external int timeout; + + @ffi.Uint8() + external int max_route_hop_count; +} + +class wire_VeilidConfigDHT extends ffi.Struct { + external ffi.Pointer resolve_node_timeout; + + @ffi.Uint32() + external int resolve_node_count; + + @ffi.Uint32() + external int resolve_node_fanout; + + @ffi.Uint32() + external int max_find_node_count; + + external ffi.Pointer get_value_timeout; + + @ffi.Uint32() + external int get_value_count; + + @ffi.Uint32() + external int get_value_fanout; + + external ffi.Pointer set_value_timeout; + + @ffi.Uint32() + external int set_value_count; + + @ffi.Uint32() + external int set_value_fanout; + + @ffi.Uint32() + external int min_peer_count; + + @ffi.Uint64() + external int min_peer_refresh_time; + + @ffi.Uint64() + external int validate_dial_info_receipt_time; +} + +class wire_VeilidConfigUDP extends ffi.Struct { + @ffi.Uint8() + external int enabled; + + @ffi.Uint32() + external int socket_pool_size; + + external ffi.Pointer listen_address; + + external ffi.Pointer public_address; +} + +class wire_VeilidConfigTCP extends ffi.Struct { + @ffi.Uint8() + external int connect; + + @ffi.Uint8() + external int listen; + + @ffi.Uint32() + external int max_connections; + + external ffi.Pointer listen_address; + + external ffi.Pointer public_address; +} + +class wire_VeilidConfigWS extends ffi.Struct { + @ffi.Uint8() + external int connect; + + @ffi.Uint8() + external int listen; + + @ffi.Uint32() + external int max_connections; + + external ffi.Pointer listen_address; + + external ffi.Pointer path; + + external ffi.Pointer url; +} + +class wire_VeilidConfigWSS extends ffi.Struct { + @ffi.Uint8() + external int connect; + + @ffi.Uint32() + external int max_connections; +} + +class wire_VeilidConfigProtocol extends ffi.Struct { + external wire_VeilidConfigUDP udp; + + external wire_VeilidConfigTCP tcp; + + external wire_VeilidConfigWS ws; + + external wire_VeilidConfigWSS wss; +} + +class wire_VeilidConfigLeases extends ffi.Struct { + @ffi.Uint32() + external int max_server_signal_leases; + + @ffi.Uint32() + external int max_server_relay_leases; + + @ffi.Uint32() + external int max_client_signal_leases; + + @ffi.Uint32() + external int max_client_relay_leases; +} + +class wire_VeilidConfigNetwork extends ffi.Struct { + @ffi.Uint32() + external int max_connections; + + @ffi.Uint64() + external int connection_initial_timeout; + + external ffi.Pointer node_id; + + external ffi.Pointer node_id_secret; + + external ffi.Pointer bootstrap; + + external wire_VeilidConfigRPC rpc; + + external wire_VeilidConfigDHT dht; + + @ffi.Uint8() + external int upnp; + + @ffi.Uint8() + external int natpmp; + + @ffi.Uint8() + external int enable_local_peer_scope; + + @ffi.Uint32() + external int restricted_nat_retries; + + external wire_VeilidConfigProtocol protocol; + + external wire_VeilidConfigLeases leases; +} + +class wire_VeilidConfig extends ffi.Struct { + external ffi.Pointer program_name; + + external ffi.Pointer namespace_; + + external wire_VeilidConfigCapabilities capabilities; + + external wire_VeilidConfigProtectedStore protected_store; + + external wire_VeilidConfigTableStore table_store; + + external wire_VeilidConfigBlockStore block_store; + + external wire_VeilidConfigNetwork network; +} + +typedef DartPostCObjectFnType = ffi.Pointer< + ffi.NativeFunction)>>; +typedef DartPort = ffi.Int64; diff --git a/veilid-flutter/rust/.gitignore b/veilid-flutter/rust/.gitignore index 22282470..acb5dfa9 100644 --- a/veilid-flutter/rust/.gitignore +++ b/veilid-flutter/rust/.gitignore @@ -1,3 +1,5 @@ +src/bridge_generated.rs + ############################################################################## ### MacOS diff --git a/veilid-flutter/rust/Cargo.lock b/veilid-flutter/rust/Cargo.lock new file mode 100644 index 00000000..c17b4259 --- /dev/null +++ b/veilid-flutter/rust/Cargo.lock @@ -0,0 +1,3059 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aes" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +dependencies = [ + "aes-soft", + "aesni", + "cipher 0.2.5", +] + +[[package]] +name = "aes-soft" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" +dependencies = [ + "cipher 0.2.5", + "opaque-debug", +] + +[[package]] +name = "aesni" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" +dependencies = [ + "cipher 0.2.5", + "opaque-debug", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.4", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "allo-isolate" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31644a919a9e4b0188e4569e55bbf5a78b5588ea645acffc15c29240407261bc" +dependencies = [ + "atomic", +] + +[[package]] +name = "android_log-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" + +[[package]] +name = "android_logger" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ed09b18365ed295d722d0b5ed59c01b79a826ff2d2a8f73d5ecca8e6fb2f66" +dependencies = [ + "android_log-sys", + "env_logger", + "lazy_static", + "log", +] + +[[package]] +name = "anyhow" +version = "1.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "async-channel" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-mutex", + "blocking", + "futures-lite", + "num_cpus", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +dependencies = [ + "concurrent-queue", + "futures-lite", + "libc", + "log", + "once_cell", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "winapi", +] + +[[package]] +name = "async-lock" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-process" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83137067e3a2a6a06d67168e49e68a0957d215410473a740cea95a2425c0b7c6" +dependencies = [ + "async-io", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "libc", + "once_cell", + "signal-hook", + "winapi", +] + +[[package]] +name = "async-std" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952" +dependencies = [ + "async-channel", + "async-global-executor", + "async-io", + "async-lock", + "async-process", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "num_cpus", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" + +[[package]] +name = "async-tls" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f23d769dbf1838d5df5156e7b1ad404f4c463d1ac2c6aeb6cd943630f8a8400" +dependencies = [ + "futures-core", + "futures-io", + "rustls", + "webpki 0.21.4", + "webpki-roots 0.21.1", +] + +[[package]] +name = "async-tungstenite" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5682ea0913e5c20780fe5785abacb85a411e7437bf52a1bedb93ddb3972cb8dd" +dependencies = [ + "async-std", + "async-tls", + "futures-io", + "futures-util", + "log", + "pin-project-lite", + "tungstenite", +] + +[[package]] +name = "async_executors" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0b8626a279ab86ef8ba31cc91549e3386eb7883cd94305896d438aa6535c62" +dependencies = [ + "async-std", + "blanket", + "futures-core", + "futures-task", + "futures-util", + "pin-project", + "rustc_version", + "wasm-bindgen-futures", +] + +[[package]] +name = "async_io_stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +dependencies = [ + "futures", + "pharos", + "rustc_version", +] + +[[package]] +name = "atomic" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b88d82667eca772c4aa12f0f1348b3ae643424c8876448f3f7bd5787032e234c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "atomic-waker" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "backtrace" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "blake3" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882e99e4a0cb2ae6cb6e442102e8e6b7131718d94110e64c3e6a34ea9b106f37" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "cc", + "cfg-if 1.0.0", + "constant_time_eq", +] + +[[package]] +name = "blanket" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b04ce3d2372d05d1ef4ea3fdf427da6ae3c17ca06d688a107b5344836276bc3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-modes" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" +dependencies = [ + "block-padding", + "cipher 0.2.5", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "blocking" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046e47d4b2d391b1f6f8b407b1deb8dee56c1852ccd868becf2710f601b5f427" +dependencies = [ + "async-channel", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "once_cell", +] + +[[package]] +name = "bugsalot" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ecfa84116fbdfe0a25779563defa5e6600ec6ef041017efe21ef494206e6928" + +[[package]] +name = "bumpalo" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cache-padded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" + +[[package]] +name = "capnp" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16c262726f68118392269a3f7a5546baf51dcfe5cb3c3f0957b502106bf1a065" + +[[package]] +name = "capnpc" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "682f2a7a680ac01d07fcc5e201cf23e5de65f528dfad7305e4a0a5312d35952f" +dependencies = [ + "capnp", +] + +[[package]] +name = "cc" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chacha20" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee7ad89dc1128635074c268ee661f90c3f7e83d9fd12910608c36b47d6c3412" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.3.0", + "cpufeatures 0.1.5", + "zeroize", +] + +[[package]] +name = "chacha20poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1580317203210c517b6d44794abfbe600698276db18127e37ad3e69bf5e848e5" +dependencies = [ + "aead", + "chacha20", + "cipher 0.3.0", + "poly1305", + "zeroize", +] + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits 0.2.14", + "time", + "winapi", +] + +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "combine" +version = "4.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", +] + +[[package]] +name = "config" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369" +dependencies = [ + "lazy_static", + "nom", + "rust-ini", + "serde 1.0.133", + "serde-hjson", + "serde_json", + "toml", + "yaml-rust", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "core-foundation" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" +dependencies = [ + "core-foundation-sys 0.6.2", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +dependencies = [ + "core-foundation-sys 0.8.3", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +dependencies = [ + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" +dependencies = [ + "cfg-if 1.0.0", + "lazy_static", +] + +[[package]] +name = "crypto-mac" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctor" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-ng" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" +dependencies = [ + "byteorder", + "digest", + "rand_core 0.6.3", + "subtle-ng", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "data-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "directories" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "ed25519" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74e1069e39f1454367eb2de793ed062fac4c35c2934b76a81d90dd9abcd28816" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "sha2", + "zeroize", +] + +[[package]] +name = "enumflags2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83c8d82922337cd23a15f88b70d8e4ef5f11da38dd7cdb55e84dd5de99695da0" +dependencies = [ + "enumflags2_derive", + "serde 1.0.133", +] + +[[package]] +name = "enumflags2_derive" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "946ee94e3dbf58fdd324f9ce245c7b238d46a66f00e86a020b71996349e46cce" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "env_logger" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "event-listener" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fastrand" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "779d043b6a0b90cc4c0ed7ee380a6504394cee7efd7db050e3774eee387324b2" +dependencies = [ + "instant", +] + +[[package]] +name = "flutter_rust_bridge" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc362d4b7a9c629eca5d3014fb93059cde6bcfc7914fcd01973eb0e3d3405fe4" +dependencies = [ + "allo-isolate", + "anyhow", + "flutter_rust_bridge_macros", + "lazy_static", + "parking_lot", + "threadpool", +] + +[[package]] +name = "flutter_rust_bridge_macros" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1bc900a5bad382bef55a85c7cc510721b49988e3bd2b5a2b26540851101ad90" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "fs4" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cef5c93884e5cef757f63446122c2f420713c3e03f85540d09485b9415983b4a" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "futures" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" + +[[package]] +name = "futures-executor" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" + +[[package]] +name = "futures-task" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72" + +[[package]] +name = "futures-util" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" + +[[package]] +name = "gloo-timers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f16c88aa13d2656ef20d1c042086b8767bbe2bdb62526894275a1b062161b2e" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashlink" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +dependencies = [ + "hashbrown 0.11.2", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" +dependencies = [ + "digest", + "hmac", +] + +[[package]] +name = "hmac" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" +dependencies = [ + "crypto-mac", + "digest", +] + +[[package]] +name = "http" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "httparse" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "ifstructs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b24d770f92a5ea876a33851b16553f21985bb83e7fe8e7e1f596ad75545e9581" +dependencies = [ + "cfg-if 0.1.10", + "libc", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keychain-services" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd01702fbd22eee99431f553959f86d558cfc1dbf7f98b8df159be14e29a349" +dependencies = [ + "core-foundation 0.6.4", + "failure", + "failure_derive", +] + +[[package]] +name = "keyring-manager" +version = "0.5.0" +dependencies = [ + "byteorder", + "cfg-if 1.0.0", + "core-foundation 0.9.2", + "core-foundation-sys 0.8.3", + "directories", + "fs4", + "jni", + "keychain-services", + "lazy_static", + "log", + "ndk", + "ndk-glue", + "secret-service", + "security-framework", + "security-framework-sys", + "serde 1.0.133", + "serde_cbor", + "snailquote", + "winapi", +] + +[[package]] +name = "keyvaluedb" +version = "0.1.0" +dependencies = [ + "smallvec", +] + +[[package]] +name = "keyvaluedb-memorydb" +version = "0.1.0" +dependencies = [ + "keyvaluedb", + "parking_lot", +] + +[[package]] +name = "keyvaluedb-sqlite" +version = "0.1.0" +dependencies = [ + "hex", + "keyvaluedb", + "log", + "parking_lot", + "rusqlite", +] + +[[package]] +name = "keyvaluedb-web" +version = "0.1.0" +dependencies = [ + "futures", + "js-sys", + "keyvaluedb", + "keyvaluedb-memorydb", + "log", + "parking_lot", + "send_wrapper", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lexical-core" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" +dependencies = [ + "arrayvec 0.5.2", + "bitflags", + "cfg-if 1.0.0", + "ryu", + "static_assertions", +] + +[[package]] +name = "libc" +version = "0.2.112" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" + +[[package]] +name = "libsqlite3-sys" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cafc7c74096c336d9d27145f7ebd4f4b6f95ba16aa5a282387267e6925cb58" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" + +[[package]] +name = "lock_api" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if 1.0.0", + "value-bag", +] + +[[package]] +name = "lru" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "274353858935c992b13c0ca408752e2121da852d07dec7ce5f108c77dfa14d1f" +dependencies = [ + "hashbrown 0.11.2", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memchr" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg", +] + +[[package]] +name = "nb-connect" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1bb540dc6ef51cfe1916ec038ce7a620daf3a111e2502d745197cd53d6bca15" +dependencies = [ + "libc", + "socket2", +] + +[[package]] +name = "ndk" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-glue" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c0d14b0858eb9962a5dac30b809b19f19da7e4547d64af2b0bb051d2e55d79" +dependencies = [ + "android_logger", + "lazy_static", + "libc", + "log", + "ndk", + "ndk-macro", + "ndk-sys", +] + +[[package]] +name = "ndk-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" +dependencies = [ + "darling", + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "netlink-packet-core" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8349128e95f5dabcb8a18587ad06b3ca7993e90c0c360b4a2abac0313ebce727" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb5d54077de7c0904111e1d19b661b8cfccbc23d9ce5b6dbcc7362721e6e552" +dependencies = [ + "anyhow", + "bitflags", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a008a56eceb0cab06739c7f37f15bda27f1147a14d0e7136e8c913b94f1441d" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-proto" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "073885f70c1d54fdc6148075e8e38a5e8a28179f59de5bd0fc6277cae4fec95a" +dependencies = [ + "bytes", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "tokio", +] + +[[package]] +name = "netlink-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed51a4602bb956eefef0ebc15f478bf9732fa3cc706e0a37112e654f41c5b92c" +dependencies = [ + "async-io", + "bytes", + "futures", + "libc", + "log", +] + +[[package]] +name = "nix" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5e06129fb611568ef4e868c14b326274959aa70ff7776e9d55323531c374945" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", + "libc", + "memoffset", +] + +[[package]] +name = "nix" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3bb9a13fa32bc5aeb64150cd3f32d6cf4c748f8f8a417cce5d2eb976a8370ba" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", + "libc", + "memoffset", +] + +[[package]] +name = "no-std-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + +[[package]] +name = "nom" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +dependencies = [ + "lexical-core", + "memchr", + "version_check", +] + +[[package]] +name = "num" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7a8e9be5e039e2ff869df49155f1c06bd01ade2117ec783e56ab0932b67a8f" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits 0.2.14", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-complex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" +dependencies = [ + "num-traits 0.2.14", +] + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits 0.2.14", +] + +[[package]] +name = "num-iter" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" +dependencies = [ + "autocfg", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.14", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "object" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "paste" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pharos" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +dependencies = [ + "futures", + "rustc_version", +] + +[[package]] +name = "pin-project" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" + +[[package]] +name = "polling" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "log", + "wepoll-ffi", + "winapi", +] + +[[package]] +name = "poly1305" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +dependencies = [ + "cpufeatures 0.2.1", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro2" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.4", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "redox_syscall" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.4", + "redox_syscall", +] + +[[package]] +name = "regex" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rtnetlink" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa584f57f271d3fbd9f59503b090a0410a531c8cc272143669bf136c62ef409d" +dependencies = [ + "async-global-executor", + "futures", + "log", + "netlink-packet-route", + "netlink-proto", + "nix 0.22.2", + "thiserror", +] + +[[package]] +name = "rusqlite" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ba4d3462c8b2e4d7f4fcfcf2b296dc6b65404fbbc7b63daa37fd485c149daf7" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "memchr", + "smallvec", +] + +[[package]] +name = "rust-fsm" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9ee4731a0f53c973772b83c43c57a26e146b6fa024af5aeab972b63d678b65" +dependencies = [ + "rust-fsm-dsl", +] + +[[package]] +name = "rust-fsm-dsl" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44237c429621e3606374941c3061fe95686bdaddb9b4f6524e4edc2d21da9c58" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "rust-ini" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64", + "log", + "ring", + "sct", + "webpki 0.21.4", +] + +[[package]] +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64", +] + +[[package]] +name = "ryu" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "secret-service" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2400fb1bf2a87b303ada204946294f932ade4929477e9e2bf66d7b49a66656ec" +dependencies = [ + "aes", + "block-modes", + "hkdf", + "lazy_static", + "num", + "rand 0.8.4", + "serde 1.0.133", + "sha2", + "zbus", + "zbus_macros", + "zvariant", + "zvariant_derive", +] + +[[package]] +name = "security-framework" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" +dependencies = [ + "bitflags", + "core-foundation 0.9.2", + "core-foundation-sys 0.8.3", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e90dd10c41c6bfc633da6e0c659bd25d31e0791e5974ac42970267d59eba87f7" +dependencies = [ + "core-foundation-sys 0.8.3", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" + +[[package]] +name = "send_wrapper" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "930c0acf610d3fdb5e2ab6213019aaa04e227ebe9547b0649ba599b16d788bd7" + +[[package]] +name = "serde" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" + +[[package]] +name = "serde" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-big-array" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18b20e7752957bbe9661cff4e0bb04d183d0948cdab2ea58cdb9df36a61dfe62" +dependencies = [ + "serde 1.0.133", + "serde_derive", +] + +[[package]] +name = "serde-hjson" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a3a4e0ea8a88553209f6cc6cfe8724ecad22e1acf372793c27d995290fe74f8" +dependencies = [ + "lazy_static", + "num-traits 0.1.43", + "regex", + "serde 0.8.23", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde 1.0.133", +] + +[[package]] +name = "serde_derive" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c059c05b48c5c0067d4b4b2b4f0732dd65feb52daf7e0ea09cd87e7dadc1af79" +dependencies = [ + "itoa", + "ryu", + "serde 1.0.133", +] + +[[package]] +name = "serde_repr" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer", + "cfg-if 1.0.0", + "cpufeatures 0.2.1", + "digest", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer", + "cfg-if 1.0.0", + "cpufeatures 0.2.1", + "digest", + "opaque-debug", +] + +[[package]] +name = "signal-hook" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" + +[[package]] +name = "slab" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" + +[[package]] +name = "smallvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" + +[[package]] +name = "snailquote" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec62a949bda7f15800481a711909f946e1204f2460f89210eaf7f57730f88f86" +dependencies = [ + "thiserror", + "unicode_categories", +] + +[[package]] +name = "socket2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "subtle-ng" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" + +[[package]] +name = "syn" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "thiserror" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "tinyvec" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838" +dependencies = [ + "bytes", + "memchr", + "pin-project-lite", +] + +[[package]] +name = "toml" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +dependencies = [ + "serde 1.0.133", +] + +[[package]] +name = "tungstenite" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1" +dependencies = [ + "base64", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand 0.8.4", + "sha-1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "uluru" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "794a32261a1f5eb6a4462c81b59cec87b5c27d5deea7dd1ac8fc781c41d226db" +dependencies = [ + "arrayvec 0.7.2", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" + +[[package]] +name = "unicode-normalization" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "value-bag" +version = "1.0.0-alpha.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79923f7731dc61ebfba3633098bf3ac533bbd35ccd8c57e7088d9a5eebe0263f" +dependencies = [ + "ctor", + "version_check", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "veilid-core" +version = "0.1.0" +dependencies = [ + "android_logger", + "anyhow", + "async-channel", + "async-lock", + "async-std", + "async-tls", + "async-tungstenite", + "async_executors", + "backtrace", + "blake3", + "bugsalot", + "capnp", + "capnpc", + "cfg-if 1.0.0", + "chacha20poly1305", + "chrono", + "config", + "console_error_panic_hook", + "curve25519-dalek-ng", + "data-encoding", + "digest", + "directories", + "ed25519-dalek", + "futures-util", + "generic-array", + "getrandom 0.2.4", + "hashbrown 0.12.0", + "hex", + "ifstructs", + "jni", + "jni-sys", + "js-sys", + "keyring-manager", + "keyvaluedb-sqlite", + "keyvaluedb-web", + "lazy_static", + "libc", + "log", + "lru", + "maplit", + "ndk", + "ndk-glue", + "no-std-net", + "num_cpus", + "once_cell", + "parking_lot", + "rand 0.7.3", + "rtnetlink", + "rusqlite", + "rust-fsm", + "rustls", + "rustls-pemfile", + "secrecy", + "serde 1.0.133", + "serde-big-array", + "serde_cbor", + "socket2", + "static_assertions", + "thiserror", + "uluru", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-logger", + "web-sys", + "webpki 0.22.0", + "webpki-roots 0.22.2", + "wee_alloc", + "winapi", + "ws_stream_wasm", + "x25519-dalek-ng", +] + +[[package]] +name = "veilid-flutter" +version = "0.1.0" +dependencies = [ + "async-std", + "cfg-if 1.0.0", + "flutter_rust_bridge", + "log", + "veilid-core", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasm-bindgen" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" + +[[package]] +name = "wasm-logger" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074649a66bb306c8f2068c9016395fa65d8e08d2affcbf95acf3c24c3ab19718" +dependencies = [ + "log", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +dependencies = [ + "webpki 0.21.4", +] + +[[package]] +name = "webpki-roots" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449" +dependencies = [ + "webpki 0.22.0", +] + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "ws_stream_wasm" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47ca1ab42f5afed7fc332b22b6e932ca5414b209465412c8cdf0ad23bc0de645" +dependencies = [ + "async_io_stream", + "futures", + "js-sys", + "pharos", + "rustc_version", + "send_wrapper", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "x25519-dalek-ng" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7074de8999662970c3c4c8f7f30925028dd8f4ca31ad4c055efa9cdf2ec326" +dependencies = [ + "curve25519-dalek-ng", + "rand 0.8.4", + "rand_core 0.6.3", + "zeroize", +] + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "zbus" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5983c3d035549ab80db67c844ec83ed271f7c1f2546fd9577c594d34c1b6c85" +dependencies = [ + "async-io", + "byteorder", + "derivative", + "enumflags2", + "fastrand", + "futures", + "nb-connect", + "nix 0.20.2", + "once_cell", + "polling", + "scoped-tls", + "serde 1.0.133", + "serde_repr", + "zbus_macros", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bce54ac7b2150a2fa21ad5842a7470ce2288158d7da1f9bfda8ad455a1c59a97" +dependencies = [ + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc222aec311c323c717f56060324f32b82da1ce1dd81d9a09aa6a9030bfe08db" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zvariant" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a68c7b55f2074489b7e8e07d2d0a6ee6b4f233867a653c664d8020ba53692525" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde 1.0.133", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ca5e22593eb4212382d60d26350065bf2a02c34b85bc850474a74b589a3de9" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] diff --git a/veilid-flutter/rust/Cargo.toml b/veilid-flutter/rust/Cargo.toml index 4535f9a2..aaa0d04d 100644 --- a/veilid-flutter/rust/Cargo.toml +++ b/veilid-flutter/rust/Cargo.toml @@ -4,9 +4,13 @@ version = "0.1.0" edition = "2021" [lib] -crate-type = ["cdylib"] +crate-type = ["cdylib", "staticlib"] [dependencies] +async-std = { version = "^1", features = ["unstable"] } veilid-core = { path="../../veilid-core" } flutter_rust_bridge = "^1" +log = "^0" +[build-dependencies] +cfg-if = "^1" diff --git a/veilid-flutter/rust/build.rs b/veilid-flutter/rust/build.rs new file mode 100644 index 00000000..fd607976 --- /dev/null +++ b/veilid-flutter/rust/build.rs @@ -0,0 +1,87 @@ +use cfg_if::*; +use std::env; +use std::ffi::OsStr; +use std::fs; +use std::path::{Path, PathBuf}; +use std::process::Command; + +fn resolve_llvm_path() -> Option { + let paths: Vec = + env::var_os("PATH").map(|paths| env::split_paths(&paths).collect())?; + + cfg_if! { + if #[cfg(target_os="linux")] { + // build host is linux + + // find clang + let d = paths.iter().find_map(|p| { + if p.join("clang").exists() { + if let Ok(real_clang_path) = fs::canonicalize(p.join("clang")) { + if let Some(llvmbindir) = real_clang_path.parent() { + if let Some(llvmdir) = llvmbindir.parent() { + return Some(llvmdir.to_owned()); + } + } + } + } + None + }); + + d.or_else(|| { + ["/usr/lib/llvm-13", "/usr/lib/llvm-12", "/usr/lib/llvm-11", "/usr/lib/llvm-10"].iter().map(Path::new).find_map(|p| if p.exists() { Some(p.to_owned()) } else { None } ) + }) + + } else if #[cfg(target_os="macos")] { + // build host is mac + ["/opt/homebrew/opt/llvm", "/usr/local/homebrew/opt/llvm"].iter().map(Path::new).find_map(|p| if p.exists() { Some(p.to_owned()) } else { None } ) + } else { + // anywhere else, just use the default paths + llvm_path = None; + } + } +} + +fn main() { + //let out_dir = env::var_os("OUT_DIR").unwrap(); + let manifest_dir = env::var_os("CARGO_MANIFEST_DIR").unwrap(); + + let input_path = Path::new(&manifest_dir).join("src").join("api.rs"); + let output_path = Path::new(&manifest_dir) + .parent() + .unwrap() + .join("lib") + .join("bridge_generated.dart"); + let llvm_path = resolve_llvm_path(); + + eprintln!("input_path: {:?}", input_path); + eprintln!("output_path: {:?}", output_path); + eprintln!("llvm_path: {:?}", llvm_path); + + let mut command = Command::new("flutter_rust_bridge_codegen"); + if let Some(llvm_path) = llvm_path { + command.args([ + OsStr::new("--rust-input"), + input_path.as_os_str(), + OsStr::new("--dart-output"), + output_path.as_os_str(), + OsStr::new("--llvm-path"), + llvm_path.as_os_str(), + ]); + } else { + command.args([ + OsStr::new("--rust-input"), + input_path.as_os_str(), + OsStr::new("--dart-output"), + output_path.as_os_str(), + ]); + } + + let mut child = command + .spawn() + .expect("flutter_rust_bridge_codegen did not execute correctly"); + child + .wait() + .expect("flutter_rust_bridge_codegen was not running"); + + println!("cargo:rerun-if-changed=src/api.c"); +} diff --git a/veilid-flutter/rust/src/api.rs b/veilid-flutter/rust/src/api.rs index 1dbf2ced..f2dfe774 100644 --- a/veilid-flutter/rust/src/api.rs +++ b/veilid-flutter/rust/src/api.rs @@ -1,4 +1,7 @@ +use std::sync::Arc; use flutter_rust_bridge::*; +use log::*; +use std::collections::HashMap; ///////////////////////////////////////// // Config Settings @@ -84,8 +87,8 @@ pub struct VeilidConfigLeases { pub struct VeilidConfigNetwork { pub max_connections: u32, pub connection_initial_timeout: u64, - pub node_id: key::DHTKey, - pub node_id_secret: key::DHTKeySecret, + pub node_id: String, + pub node_id_secret: String, pub bootstrap: Vec, pub rpc: VeilidConfigRPC, pub dht: VeilidConfigDHT, @@ -93,7 +96,6 @@ pub struct VeilidConfigNetwork { pub natpmp: bool, pub enable_local_peer_scope: bool, pub restricted_nat_retries: u32, - pub tls: VeilidConfigTLS, pub protocol: VeilidConfigProtocol, pub leases: VeilidConfigLeases, } @@ -146,10 +148,10 @@ pub struct VeilidConfig { ///////////////////////////////////////// #[derive(Debug)] -pub enum APIErrorKind { +pub enum VeilidAPIError { AlreadyInitialized, NotInitialized, - InvalidConfig, + InvalidConfig(String), Timeout, Shutdown, NodeNotFound(String), @@ -171,10 +173,20 @@ pub enum APIErrorKind { }, } -#[derive(Debug)] -pub struct VeilidAPIError { - kind: APIErrorKind, - message: String, +impl VeilidAPIError { + fn from_core(api_error: veilid_core::VeilidAPIError) -> Self { + match api_error { + veilid_core::VeilidAPIError::Timeout => VeilidAPIError::Timeout, + veilid_core::VeilidAPIError::Shutdown => VeilidAPIError::Shutdown, + veilid_core::VeilidAPIError::NodeNotFound(node_id) => VeilidAPIError::NodeNotFound(format!("{}",node_id)), + veilid_core::VeilidAPIError::NoDialInfo(node_id) => VeilidAPIError::NodeNotFound(format!("{}",node_id)), + veilid_core::VeilidAPIError::Internal(msg) => VeilidAPIError::Internal(msg.clone()), + veilid_core::VeilidAPIError::Unimplemented(msg)=> VeilidAPIError::Unimplemented(msg.clone()), + veilid_core::VeilidAPIError::ParseError{message, value} => VeilidAPIError::ParseError{ message: message.clone(), value: value.clone() }, + veilid_core::VeilidAPIError::InvalidArgument { context, argument, value } => VeilidAPIError::InvalidArgument{ context: context.clone(), argument: argument.clone(), value: value.clone() }, + veilid_core::VeilidAPIError::MissingArgument {context, argument } => VeilidAPIError::MissingArgument{ context: context.clone(), argument: argument.clone() }, + } + } } #[derive(Debug)] @@ -189,25 +201,185 @@ pub enum AttachmentState { Detaching, } +impl AttachmentState { + fn from_core(attachment_state: veilid_core::AttachmentState) -> Self { + match attachment_state { + veilid_core::AttachmentState::Detached => AttachmentState::Detached, + veilid_core::AttachmentState::Attaching=> AttachmentState::Attaching, + veilid_core::AttachmentState::AttachedWeak=> AttachmentState::AttachedWeak, + veilid_core::AttachmentState::AttachedGood=> AttachmentState::AttachedGood, + veilid_core::AttachmentState::AttachedStrong=> AttachmentState::AttachedStrong, + veilid_core::AttachmentState::FullyAttached=> AttachmentState::FullyAttached, + veilid_core::AttachmentState::OverAttached=> AttachmentState::OverAttached, + veilid_core::AttachmentState::Detaching=> AttachmentState::Detaching, + } + } +} + + #[derive(Debug)] pub enum VeilidUpdate { Attachment (AttachmentState), } -///////////////////////////////////////// -/// -pub fn startup_veilid_core(sink: StreamSink, config: VeilidConfig) -> Result<(), VeilidAPIError> { - let core = veilid_core::VeilidCore::new(); - - core. +impl VeilidUpdate { + fn from_core(veilid_update: veilid_core::VeilidUpdate) -> Self { + match veilid_update { + veilid_core::VeilidUpdate::Attachment(attachment) => Self::Attachment(AttachmentState::from_core(attachment)) + } + } } -pub fn get_veilid_state() -> Result { + +#[derive(Debug)] +pub struct VeilidState { + attachment: AttachmentState, +} + +impl VeilidState { + fn from_core(veilid_state: veilid_core::VeilidState) -> Self { + Self { + attachment: AttachmentState::from_core(veilid_state.attachment) + } + } +} + +type Result = std::result::Result; + +///////////////////////////////////////// +pub fn startup_veilid_core(sink: StreamSink, config: VeilidConfig) -> Result { + let core = veilid_core::VeilidCore::new(); + + // convert config to hashmap + let config_map = HashMap::>::new(); + macro_rules! get_config { + ($key:expr) => { + config_map.insert(stringify!($key)[7..].to_owned(), Box::new($key.clone())); + } + } + macro_rules! default_config { + ($key:expr, $default_value:expr) => { + config_map.insert(stringify!($key)[7..].to_owned(), Box::new($default_value)); + } + } + get_config!(config.program_name); + get_config!(config.namespace); + get_config!(config.capabilities.protocol_udp); + get_config!(config.capabilities.protocol_connect_tcp); + get_config!(config.capabilities.protocol_accept_tcp); + get_config!(config.capabilities.protocol_connect_ws); + get_config!(config.capabilities.protocol_accept_ws); + get_config!(config.capabilities.protocol_connect_wss); + get_config!(config.capabilities.protocol_accept_wss); + get_config!(config.table_store.directory); + get_config!(config.table_store.delete); + get_config!(config.block_store.directory); + get_config!(config.block_store.delete); + get_config!(config.protected_store.allow_insecure_fallback); + get_config!(config.protected_store.always_use_insecure_storage); + get_config!(config.protected_store.insecure_fallback_directory); + get_config!(config.protected_store.delete); + get_config!(config.network.node_id); + get_config!(config.network.node_id_secret); + get_config!(config.network.max_connections); + get_config!(config.network.connection_initial_timeout); + get_config!(config.network.bootstrap); + get_config!(config.network.dht.resolve_node_timeout); + get_config!(config.network.dht.resolve_node_count); + get_config!(config.network.dht.resolve_node_fanout); + get_config!(config.network.dht.max_find_node_count); + get_config!(config.network.dht.get_value_timeout); + get_config!(config.network.dht.get_value_count); + get_config!(config.network.dht.get_value_fanout); + get_config!(config.network.dht.set_value_timeout); + get_config!(config.network.dht.set_value_count); + get_config!(config.network.dht.set_value_fanout); + get_config!(config.network.dht.min_peer_count); + get_config!(config.network.dht.min_peer_refresh_time); + get_config!(config.network.dht.validate_dial_info_receipt_time); + get_config!(config.network.rpc.concurrency); + get_config!(config.network.rpc.queue_size); + get_config!(config.network.rpc.max_timestamp_behind); + get_config!(config.network.rpc.max_timestamp_ahead); + get_config!(config.network.rpc.timeout); + get_config!(config.network.rpc.max_route_hop_count); + get_config!(config.network.upnp); + get_config!(config.network.natpmp); + get_config!(config.network.enable_local_peer_scope); + get_config!(config.network.restricted_nat_retries); + default_config!(config.network.tls.certificate_path, ""); + default_config!(config.network.tls.private_key_path, ""); + default_config!(config.network.tls.connection_initial_timeout, 0u64); + default_config!(config.network.application.https.enabled, false); + default_config!(config.network.application.https.listen_address, ""); + default_config!(config.network.application.https.path, ""); + default_config!(config.network.application.https.url, Option::::None); + default_config!(config.network.application.http.enabled, false); + default_config!(config.network.application.http.listen_address, ""); + default_config!(config.network.application.http.path, ""); + default_config!(config.network.application.http.url, Option::::None); + get_config!(config.network.protocol.udp.enabled); + get_config!(config.network.protocol.udp.socket_pool_size); + get_config!(config.network.protocol.udp.listen_address); + get_config!(config.network.protocol.udp.public_address); + get_config!(config.network.protocol.tcp.connect); + get_config!(config.network.protocol.tcp.listen); + get_config!(config.network.protocol.tcp.max_connections); + get_config!(config.network.protocol.tcp.listen_address); + get_config!(config.network.protocol.tcp.public_address); + get_config!(config.network.protocol.ws.connect); + get_config!(config.network.protocol.ws.listen); + get_config!(config.network.protocol.ws.max_connections); + get_config!(config.network.protocol.ws.listen_address); + get_config!(config.network.protocol.ws.path); + get_config!(config.network.protocol.ws.url); + get_config!(config.network.protocol.wss.connect); + default_config!(config.network.protocol.wss.listen, false); + get_config!(config.network.protocol.wss.max_connections); + default_config!(config.network.protocol.wss.listen_address, ""); + default_config!(config.network.protocol.wss.path, ""); + default_config!(config.network.protocol.wss.url, Option::::None); + get_config!(config.network.leases.max_server_signal_leases); + get_config!(config.network.leases.max_server_relay_leases); + get_config!(config.network.leases.max_client_signal_leases); + get_config!(config.network.leases.max_client_relay_leases); + + let setup = veilid_core::VeilidCoreSetup { + update_callback: Arc::new( + move |update: veilid_core::VeilidUpdate| -> veilid_core::SystemPinBoxFuture<()> { + Box::pin(async move { + if !sink.add(VeilidUpdate::from_core(update)) { + error!("error sending veilid update callback"); + } + }) + }, + ), + config_callback: Arc::new( + move |key| { + config_map.get(&key).ok_or_else(|| { + let err = format!("config key '{}' doesn't exist", key); + error!("{}",err); + err + }).map(|v| { + *v.clone() + }) + } + ), + }; + + async_std::task::block_on( async { + let api = core.startup(setup).await.map_err(|e| VeilidAPIError::InvalidConfig(e.clone()))?; + let core_state = api.get_state().await.map_err(VeilidAPIError::from_core)?; + Ok(VeilidState::from_core(core_state)) + }) +} + +pub fn get_veilid_state() -> Result { } // xxx api functions -pub fn shutdown_veilid_core() -> Result<(), VeilidAPIError> { +pub fn shutdown_veilid_core() -> Result<()> { } diff --git a/veilid-server/src/settings.rs b/veilid-server/src/settings.rs index 4221c9b8..d1f2c89a 100644 --- a/veilid-server/src/settings.rs +++ b/veilid-server/src/settings.rs @@ -744,7 +744,7 @@ impl Settings { Arc::new(move |key: String| { let inner = inner.read(); - let out: Result, String> = match key.as_str() { + let out: Result, String> = match key.as_str() { "program_name" => Ok(Box::new("veilid-server".to_owned())), "namespace" => Ok(Box::new(if inner.testing.subnode_index == 0 { "".to_owned()