From 1b6864bf22da08737c489251df29ee5b61fec74a Mon Sep 17 00:00:00 2001 From: John Smith Date: Tue, 18 Jan 2022 12:33:14 -0500 Subject: [PATCH] remove veilid-wasm project, too out of date refactor state updates and formalize a VeilidState object work on veilid-flutter api --- Cargo.lock | 1 - Cargo.toml | 2 +- veilid-cli/Cargo.toml | 1 - veilid-cli/src/client_api_connection.rs | 89 +- veilid-cli/src/command_processor.rs | 2 +- veilid-cli/src/main.rs | 18 +- veilid-core/src/attachment_manager.rs | 27 +- veilid-core/src/lib.rs | 2 +- veilid-core/src/tests/common/test_crypto.rs | 6 +- .../src/tests/common/test_protected_store.rs | 6 +- .../src/tests/common/test_table_store.rs | 6 +- .../src/tests/common/test_veilid_config.rs | 6 +- .../src/tests/common/test_veilid_core.rs | 2 +- veilid-core/src/veilid_api/mod.rs | 42 +- veilid-core/src/veilid_core.rs | 28 +- veilid-flutter/pubspec.yaml | 1 + veilid-flutter/rust/.gitignore | 64 + veilid-flutter/rust/Cargo.toml | 12 + veilid-flutter/rust/src/api.rs | 204 ++ veilid-flutter/rust/src/lib.rs | 2 + veilid-server/proto/veilid-client.capnp | 39 +- veilid-server/src/client_api.rs | 111 +- veilid-server/src/server.rs | 20 +- veilid-wasm/.appveyor.yml | 11 - veilid-wasm/.cargo-ok | 0 veilid-wasm/.gitignore | 5 - veilid-wasm/.travis.yml | 69 - veilid-wasm/Cargo.lock | 2868 ----------------- veilid-wasm/Cargo.toml | 27 - veilid-wasm/LICENSE_APACHE | 176 - veilid-wasm/LICENSE_MIT | 25 - veilid-wasm/README.md | 69 - veilid-wasm/src/js_veilid_core.rs | 289 -- veilid-wasm/src/lib.rs | 25 - veilid-wasm/src/utils.rs | 38 - veilid-wasm/tests/web.rs | 182 -- 36 files changed, 512 insertions(+), 3963 deletions(-) create mode 100644 veilid-flutter/rust/.gitignore create mode 100644 veilid-flutter/rust/Cargo.toml create mode 100644 veilid-flutter/rust/src/api.rs create mode 100644 veilid-flutter/rust/src/lib.rs delete mode 100644 veilid-wasm/.appveyor.yml delete mode 100644 veilid-wasm/.cargo-ok delete mode 100644 veilid-wasm/.gitignore delete mode 100644 veilid-wasm/.travis.yml delete mode 100644 veilid-wasm/Cargo.lock delete mode 100644 veilid-wasm/Cargo.toml delete mode 100644 veilid-wasm/LICENSE_APACHE delete mode 100644 veilid-wasm/LICENSE_MIT delete mode 100644 veilid-wasm/README.md delete mode 100644 veilid-wasm/src/js_veilid_core.rs delete mode 100644 veilid-wasm/src/lib.rs delete mode 100644 veilid-wasm/src/utils.rs delete mode 100644 veilid-wasm/tests/web.rs diff --git a/Cargo.lock b/Cargo.lock index 60de7f23..8c9b3489 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3774,7 +3774,6 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" name = "veilid-cli" version = "0.1.0" dependencies = [ - "anyhow", "async-std", "async-tungstenite 0.8.0", "bugsalot", diff --git a/Cargo.toml b/Cargo.toml index b6f10cc9..d919d681 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ "veilid-cli" ] -exclude = [ "./external/cursive" ] +exclude = [ "./external/cursive", "./veilid-flutter" ] [patch.crates-io] cursive = { path = "./external/cursive/cursive" } diff --git a/veilid-cli/Cargo.toml b/veilid-cli/Cargo.toml index c0dbaed0..9f1a19ac 100644 --- a/veilid-cli/Cargo.toml +++ b/veilid-cli/Cargo.toml @@ -31,7 +31,6 @@ cfg-if = "^1" capnp = "^0.14" capnp-rpc = "^0.14" config = { version = "0.10.1", features = ["yaml"] } -anyhow = "^1" bugsalot = "^0.2" flexi_logger = "0.17" thiserror = "^1.0" diff --git a/veilid-cli/src/client_api_connection.rs b/veilid-cli/src/client_api_connection.rs index cfcd8f43..a116c478 100644 --- a/veilid-cli/src/client_api_connection.rs +++ b/veilid-cli/src/client_api_connection.rs @@ -1,11 +1,11 @@ use crate::command_processor::*; use crate::veilid_client_capnp::*; -use anyhow::*; +use veilid_core::xx::*; + use async_std::prelude::*; use capnp::capability::Promise; use capnp_rpc::{pry, rpc_twoparty_capnp, twoparty, Disconnector, RpcSystem}; use futures::AsyncReadExt; -use log::*; use std::cell::RefCell; use std::net::SocketAddr; use std::rc::Rc; @@ -21,24 +21,29 @@ impl VeilidClientImpl { } impl veilid_client::Server for VeilidClientImpl { - fn state_changed( + fn update( &mut self, - params: veilid_client::StateChangedParams, - _results: veilid_client::StateChangedResults, + params: veilid_client::UpdateParams, + _results: veilid_client::UpdateResults, ) -> Promise<(), ::capnp::Error> { - let changed = pry!(pry!(params.get()).get_changed()); + let veilid_update = pry!(pry!(params.get()).get_veilid_update()); - if changed.has_attachment() { - let attachment = pry!(changed.get_attachment()); - let old_state = pry!(attachment.get_old_state()); - let new_state = pry!(attachment.get_new_state()); + let which = match veilid_update.which() { + Ok(v) => v, + Err(e) => { + panic!("(missing update kind in schema: {:?})", e); + } + }; + match which { + veilid_update::Attachment(Ok(attachment)) => { + let state = pry!(attachment.get_state()); - trace!( - "AttachmentStateChange: old_state={} new_state={}", - old_state as u16, - new_state as u16 - ); - self.comproc.set_attachment_state(new_state); + trace!("Attachment: {}", state as u16); + self.comproc.update_attachment(state); + } + _ => { + panic!("shouldn't get this") + } } Promise::ok(()) @@ -83,13 +88,15 @@ impl ClientApiConnection { } } - async fn handle_connection(&mut self) -> Result<()> { + async fn handle_connection(&mut self) -> Result<(), String> { trace!("ClientApiConnection::handle_connection"); let connect_addr = self.inner.borrow().connect_addr.unwrap(); // Connect the TCP socket - let stream = async_std::net::TcpStream::connect(connect_addr).await?; + let stream = async_std::net::TcpStream::connect(connect_addr) + .await + .map_err(map_to_string)?; // If it succeed, disable nagle algorithm - stream.set_nodelay(true)?; + stream.set_nodelay(true).map_err(map_to_string)?; // Create the VAT network let (reader, writer) = stream.split(); @@ -134,7 +141,10 @@ impl ClientApiConnection { } // Don't drop the registration - rpc_system.try_join(request.send().promise).await?; + rpc_system + .try_join(request.send().promise) + .await + .map_err(map_to_string)?; // Drop the server and disconnector too (if we still have it) let mut inner = self.inner.borrow_mut(); @@ -145,80 +155,81 @@ impl ClientApiConnection { if !disconnect_requested { // Connection lost - Err(anyhow!("Connection lost")) + Err("Connection lost".to_owned()) } else { // Connection finished Ok(()) } } - pub async fn server_attach(&mut self) -> Result<()> { + pub async fn server_attach(&mut self) -> Result<(), String> { trace!("ClientApiConnection::server_attach"); let server = { let inner = self.inner.borrow(); inner .server .as_ref() - .ok_or(anyhow!("Not connected, ignoring attach request"))? + .ok_or("Not connected, ignoring attach request".to_owned())? .clone() }; let request = server.borrow().attach_request(); - let response = request.send().promise.await?; - response.get().map(drop).map_err(|e| anyhow!(e)) + let response = request.send().promise.await.map_err(map_to_string)?; + response.get().map(drop).map_err(map_to_string) } - pub async fn server_detach(&mut self) -> Result<()> { + pub async fn server_detach(&mut self) -> Result<(), String> { trace!("ClientApiConnection::server_detach"); let server = { let inner = self.inner.borrow(); inner .server .as_ref() - .ok_or(anyhow!("Not connected, ignoring detach request"))? + .ok_or("Not connected, ignoring detach request".to_owned())? .clone() }; let request = server.borrow().detach_request(); - let response = request.send().promise.await?; - response.get().map(drop).map_err(|e| anyhow!(e)) + let response = request.send().promise.await.map_err(map_to_string)?; + response.get().map(drop).map_err(map_to_string) } - pub async fn server_shutdown(&mut self) -> Result<()> { + pub async fn server_shutdown(&mut self) -> Result<(), String> { trace!("ClientApiConnection::server_shutdown"); let server = { let inner = self.inner.borrow(); inner .server .as_ref() - .ok_or(anyhow!("Not connected, ignoring attach request"))? + .ok_or("Not connected, ignoring attach request".to_owned())? .clone() }; let request = server.borrow().shutdown_request(); - let response = request.send().promise.await?; - response.get().map(drop).map_err(|e| anyhow!(e)) + let response = request.send().promise.await.map_err(map_to_string)?; + response.get().map(drop).map_err(map_to_string) } - pub async fn server_debug(&mut self, what: String) -> Result { + pub async fn server_debug(&mut self, what: String) -> Result { trace!("ClientApiConnection::server_debug"); let server = { let inner = self.inner.borrow(); inner .server .as_ref() - .ok_or(anyhow!("Not connected, ignoring attach request"))? + .ok_or("Not connected, ignoring attach request".to_owned())? .clone() }; let mut request = server.borrow().debug_request(); request.get().set_what(&what); - let response = request.send().promise.await?; + let response = request.send().promise.await.map_err(map_to_string)?; response - .get()? + .get() + .map_err(map_to_string)? .get_output() .map(|o| o.to_owned()) - .map_err(|e| anyhow!(e)) + .map_err(map_to_string) } // Start Client API connection - pub async fn connect(&mut self, connect_addr: SocketAddr) -> Result<()> { + pub async fn connect(&mut self, connect_addr: SocketAddr) -> Result<(), String> { trace!("ClientApiConnection::connect"); // Save the address to connect to self.inner.borrow_mut().connect_addr = Some(connect_addr); diff --git a/veilid-cli/src/command_processor.rs b/veilid-cli/src/command_processor.rs index cbdb25a0..aee951cf 100644 --- a/veilid-cli/src/command_processor.rs +++ b/veilid-cli/src/command_processor.rs @@ -273,7 +273,7 @@ debug - send a debugging command to the Veilid server // called by client_api_connection // calls into ui //////////////////////////////////////////// - pub fn set_attachment_state(&mut self, state: AttachmentState) { + pub fn update_attachment(&mut self, state: AttachmentState) { self.inner_mut().ui.set_attachment_state(state); } diff --git a/veilid-cli/src/main.rs b/veilid-cli/src/main.rs index 27792912..ca3c0cef 100644 --- a/veilid-cli/src/main.rs +++ b/veilid-cli/src/main.rs @@ -1,11 +1,11 @@ #![deny(clippy::all)] #![deny(unused_must_use)] -use anyhow::*; +use veilid_core::xx::*; + use async_std::prelude::*; use clap::{App, Arg, ColorChoice}; use flexi_logger::*; -use log::*; use std::ffi::OsStr; use std::net::ToSocketAddrs; @@ -19,7 +19,7 @@ pub mod veilid_client_capnp { include!(concat!(env!("OUT_DIR"), "/proto/veilid_client_capnp.rs")); } -fn parse_command_line(default_config_path: &OsStr) -> Result { +fn parse_command_line(default_config_path: &OsStr) -> Result { let matches = App::new("veilid-cli") .version("0.1") .color(ColorChoice::Auto) @@ -59,7 +59,7 @@ fn parse_command_line(default_config_path: &OsStr) -> Result Result<()> { +async fn main() -> Result<(), String> { // Get command line options let default_config_path = settings::Settings::get_default_config_path(); let matches = parse_command_line(default_config_path.as_os_str())?; @@ -73,7 +73,7 @@ async fn main() -> Result<()> { matches.occurrences_of("config-file") == 0, matches.value_of_os("config-file").unwrap(), ) - .map_err(Box::new)?; + .map_err(map_to_string)?; // Set config from command line if matches.occurrences_of("debug") != 0 { @@ -104,7 +104,8 @@ async fn main() -> Result<()> { if settings.logging.terminal.enabled { let flv = sivui.cursive_flexi_logger(); if settings.logging.file.enabled { - std::fs::create_dir_all(settings.logging.file.directory.clone())?; + std::fs::create_dir_all(settings.logging.file.directory.clone()) + .map_err(map_to_string)?; logger .log_target(LogTarget::FileAndWriter(flv)) .suppress_timestamp() @@ -121,7 +122,8 @@ async fn main() -> Result<()> { .expect("failed to initialize logger!"); } } else if settings.logging.file.enabled { - std::fs::create_dir_all(settings.logging.file.directory.clone())?; + std::fs::create_dir_all(settings.logging.file.directory.clone()) + .map_err(map_to_string)?; logger .log_target(LogTarget::File) .suppress_timestamp() @@ -135,7 +137,7 @@ async fn main() -> Result<()> { if let Some(address_arg) = matches.value_of("address") { server_addrs = address_arg .to_socket_addrs() - .context(format!("Invalid server address '{}'", address_arg))? + .map_err(|e| format!("Invalid server address '{}'", e))? .collect() } else { server_addrs = settings.address.addrs.clone(); diff --git a/veilid-core/src/attachment_manager.rs b/veilid-core/src/attachment_manager.rs index 7b544d85..544246ae 100644 --- a/veilid-core/src/attachment_manager.rs +++ b/veilid-core/src/attachment_manager.rs @@ -367,7 +367,9 @@ impl AttachmentManager { attachment_machine.state() } - pub async fn wait_for_state(&self, state: AttachmentState) { + pub async fn wait_for_state(&self, state: AttachmentState, timeout_ms: Option) -> bool { + let start_time = intf::get_timestamp(); + loop { let (current_state, eventual) = self .inner @@ -377,9 +379,28 @@ impl AttachmentManager { if current_state == state { break; } - if eventual.await == state { - break; + if let Some(timeout_ms) = timeout_ms { + let timeout_time = start_time + (timeout_ms as u64 * 1000); + let cur_time = intf::get_timestamp(); + if timeout_time > cur_time { + let timeout_dur_ms = ((timeout_time - cur_time) / 1000) as u32; + + if match intf::timeout(timeout_dur_ms, eventual).await { + Ok(v) => v, + Err(_) => return false, + } == state + { + return true; + } + } else { + return false; + } + } else { + if eventual.await == state { + break; + } } } + true } } diff --git a/veilid-core/src/lib.rs b/veilid-core/src/lib.rs index 035bf2b2..79da5577 100644 --- a/veilid-core/src/lib.rs +++ b/veilid-core/src/lib.rs @@ -27,7 +27,7 @@ pub mod xx; pub use self::attachment_manager::AttachmentState; pub use self::veilid_api::*; pub use self::veilid_config::*; -pub use self::veilid_core::{VeilidCore, VeilidCoreSetup, VeilidState, VeilidStateChange}; +pub use self::veilid_core::{VeilidCore, VeilidCoreSetup}; pub mod veilid_capnp { include!(concat!(env!("OUT_DIR"), "/proto/veilid_capnp.rs")); diff --git a/veilid-core/src/tests/common/test_crypto.rs b/veilid-core/src/tests/common/test_crypto.rs index 68600a12..5a370243 100644 --- a/veilid-core/src/tests/common/test_crypto.rs +++ b/veilid-core/src/tests/common/test_crypto.rs @@ -8,10 +8,10 @@ static LOREM_IPSUM:&[u8] = b"Lorem ipsum dolor sit amet, consectetur adipiscing fn setup_veilid_core() -> VeilidCoreSetup { VeilidCoreSetup { - state_change_callback: Arc::new( - move |change: VeilidStateChange| -> SystemPinBoxFuture<()> { + update_callback: Arc::new( + move |veilid_update: VeilidUpdate| -> SystemPinBoxFuture<()> { Box::pin(async move { - trace!("state_change_callback: {:?}", change); + trace!("update_callback: {:?}", veilid_update); }) }, ), diff --git a/veilid-core/src/tests/common/test_protected_store.rs b/veilid-core/src/tests/common/test_protected_store.rs index 9921f3e2..58b2af95 100644 --- a/veilid-core/src/tests/common/test_protected_store.rs +++ b/veilid-core/src/tests/common/test_protected_store.rs @@ -5,10 +5,10 @@ use crate::*; fn setup_veilid_core() -> VeilidCoreSetup { VeilidCoreSetup { - state_change_callback: Arc::new( - move |change: VeilidStateChange| -> SystemPinBoxFuture<()> { + update_callback: Arc::new( + move |veilid_update: VeilidUpdate| -> SystemPinBoxFuture<()> { Box::pin(async move { - trace!("state_change_callback: {:?}", change); + trace!("update_callback: {:?}", veilid_update); }) }, ), diff --git a/veilid-core/src/tests/common/test_table_store.rs b/veilid-core/src/tests/common/test_table_store.rs index 9d73d2cc..e19e0d47 100644 --- a/veilid-core/src/tests/common/test_table_store.rs +++ b/veilid-core/src/tests/common/test_table_store.rs @@ -6,10 +6,10 @@ use crate::*; fn setup_veilid_core() -> VeilidCoreSetup { VeilidCoreSetup { - state_change_callback: Arc::new( - move |change: VeilidStateChange| -> SystemPinBoxFuture<()> { + update_callback: Arc::new( + move |veilid_update: VeilidUpdate| -> SystemPinBoxFuture<()> { Box::pin(async move { - trace!("state_change_callback: {:?}", change); + trace!("update_callback: {:?}", veilid_update); }) }, ), diff --git a/veilid-core/src/tests/common/test_veilid_config.rs b/veilid-core/src/tests/common/test_veilid_config.rs index 969bb6b3..c377c3b7 100644 --- a/veilid-core/src/tests/common/test_veilid_config.rs +++ b/veilid-core/src/tests/common/test_veilid_config.rs @@ -145,10 +145,10 @@ cfg_if! { pub fn setup_veilid_core() -> VeilidCoreSetup { VeilidCoreSetup { - state_change_callback: Arc::new( - move |change: VeilidStateChange| -> SystemPinBoxFuture<()> { + update_callback: Arc::new( + move |veilid_update: VeilidUpdate| -> SystemPinBoxFuture<()> { Box::pin(async move { - trace!("state_change_callback: {:?}", change); + trace!("update_callback: {:?}", veilid_update); }) }, ), diff --git a/veilid-core/src/tests/common/test_veilid_core.rs b/veilid-core/src/tests/common/test_veilid_core.rs index 0a2a2736..c0828248 100644 --- a/veilid-core/src/tests/common/test_veilid_core.rs +++ b/veilid-core/src/tests/common/test_veilid_core.rs @@ -25,7 +25,7 @@ pub async fn test_attach_detach() { api.attach().await.unwrap(); intf::sleep(5000).await; api.detach().await.unwrap(); - api.wait_for_state(VeilidState::Attachment(AttachmentState::Detached)) + api.wait_for_update(VeilidUpdate::Attachment(AttachmentState::Detached), None) .await .unwrap(); api.shutdown().await; diff --git a/veilid-core/src/veilid_api/mod.rs b/veilid-core/src/veilid_api/mod.rs index b264bc4f..bede52c7 100644 --- a/veilid-core/src/veilid_api/mod.rs +++ b/veilid-core/src/veilid_api/mod.rs @@ -5,7 +5,7 @@ pub use debug::*; pub use crate::rpc_processor::InfoAnswer; use crate::*; -use attachment_manager::AttachmentManager; +use attachment_manager::*; use core::fmt; use network_manager::NetworkManager; use routing_table::*; @@ -106,6 +106,18 @@ macro_rules! parse_error { ///////////////////////////////////////////////////////////////////////////////////////////////////// +#[derive(Debug)] +pub enum VeilidUpdate { + Attachment(AttachmentState), +} + +#[derive(Debug)] +pub struct VeilidState { + pub attachment: AttachmentState, +} + +///////////////////////////////////////////////////////////////////////////////////////////////////// +/// #[derive(Clone, Debug, Default, PartialOrd, PartialEq, Eq, Ord)] pub struct NodeId { pub key: DHTKey, @@ -1100,12 +1112,13 @@ impl VeilidAPI { //////////////////////////////////////////////////////////////// // Attach/Detach - // issue state changed updates for updating clients - pub async fn send_state_update(&self) -> Result<(), VeilidAPIError> { - trace!("VeilidCore::send_state_update"); + // get a full copy of the current state + pub async fn get_state(&self) -> Result { + trace!("VeilidCore::get_state"); let attachment_manager = self.attachment_manager()?; - attachment_manager.send_state_update().await; - Ok(()) + Ok(VeilidState { + attachment: attachment_manager.get_state(), + }) } // connect to the network @@ -1124,12 +1137,17 @@ impl VeilidAPI { Ok(()) } - // wait for state change - // xxx: should have optional timeout - pub async fn wait_for_state(&self, state: VeilidState) -> Result<(), VeilidAPIError> { - match state { - VeilidState::Attachment(cs) => { - self.attachment_manager()?.wait_for_state(cs).await; + // wait for a matching update + pub async fn wait_for_update( + &self, + update: VeilidUpdate, + timeout_ms: Option, + ) -> Result<(), VeilidAPIError> { + match update { + VeilidUpdate::Attachment(cs) => { + self.attachment_manager()? + .wait_for_state(cs, timeout_ms) + .await; } } Ok(()) diff --git a/veilid-core/src/veilid_core.rs b/veilid-core/src/veilid_core.rs index ed69ff09..efeb99a5 100644 --- a/veilid-core/src/veilid_core.rs +++ b/veilid-core/src/veilid_core.rs @@ -7,27 +7,14 @@ use crate::xx::*; cfg_if! { if #[cfg(target_arch = "wasm32")] { - pub type StateChangeCallback = Arc SystemPinBoxFuture<()>>; + pub type UpdateCallback = Arc SystemPinBoxFuture<()>>; } else { - pub type StateChangeCallback = Arc SystemPinBoxFuture<()> + Send + Sync>; + pub type UpdateCallback = Arc SystemPinBoxFuture<()> + Send + Sync>; } } -#[derive(Debug)] -pub enum VeilidStateChange { - Attachment { - old_state: AttachmentState, - new_state: AttachmentState, - }, -} - -#[derive(Debug)] -pub enum VeilidState { - Attachment(AttachmentState), -} - pub struct VeilidCoreSetup { - pub state_change_callback: StateChangeCallback, + pub update_callback: UpdateCallback, pub config_callback: ConfigCallback, } @@ -139,16 +126,13 @@ impl VeilidCore { // Set up attachment manager trace!("VeilidCore::internal_startup init attachment manager"); - let cb = setup.state_change_callback; + let cb = setup.update_callback; let attachment_manager = AttachmentManager::new(config.clone(), table_store.clone(), crypto.clone()); attachment_manager .init(Arc::new( - move |old_state: AttachmentState, new_state: AttachmentState| { - cb(VeilidStateChange::Attachment { - old_state, - new_state, - }) + move |_old_state: AttachmentState, new_state: AttachmentState| { + cb(VeilidUpdate::Attachment(new_state)) }, )) .await?; diff --git a/veilid-flutter/pubspec.yaml b/veilid-flutter/pubspec.yaml index 872f6ebf..3b4adb7c 100644 --- a/veilid-flutter/pubspec.yaml +++ b/veilid-flutter/pubspec.yaml @@ -13,6 +13,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter + flutter_rust_bridge: ^1.0 dev_dependencies: flutter_test: diff --git a/veilid-flutter/rust/.gitignore b/veilid-flutter/rust/.gitignore new file mode 100644 index 00000000..22282470 --- /dev/null +++ b/veilid-flutter/rust/.gitignore @@ -0,0 +1,64 @@ +############################################################################## +### MacOS + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +############################################################################## +### Windows + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +############################################################################### +### Rust +target/ +logs/ + diff --git a/veilid-flutter/rust/Cargo.toml b/veilid-flutter/rust/Cargo.toml new file mode 100644 index 00000000..4535f9a2 --- /dev/null +++ b/veilid-flutter/rust/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "veilid-flutter" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +veilid-core = { path="../../veilid-core" } +flutter_rust_bridge = "^1" + diff --git a/veilid-flutter/rust/src/api.rs b/veilid-flutter/rust/src/api.rs new file mode 100644 index 00000000..dbcc5ddc --- /dev/null +++ b/veilid-flutter/rust/src/api.rs @@ -0,0 +1,204 @@ +use flutter_rust_bridge::*; + +///////////////////////////////////////// +// Config Settings +// Not all settings available through Veilid API are available to Flutter applications + +#[derive(Debug, Default, Clone)] +pub struct VeilidConfigUDP { + pub enabled: bool, + pub socket_pool_size: u32, + pub listen_address: String, + pub public_address: Option, +} + +#[derive(Debug, Default, Clone)] +pub struct VeilidConfigTCP { + pub connect: bool, + pub listen: bool, + pub max_connections: u32, + pub listen_address: String, + pub public_address: Option, +} + +#[derive(Debug, Default, Clone)] +pub struct VeilidConfigWS { + pub connect: bool, + pub listen: bool, + pub max_connections: u32, + pub listen_address: String, + pub path: String, + pub url: Option, +} + +#[derive(Debug, Default, Clone)] +pub struct VeilidConfigWSS { + pub connect: bool, + pub max_connections: u32, +} + +#[derive(Debug, Default, Clone)] +pub struct VeilidConfigProtocol { + pub udp: VeilidConfigUDP, + pub tcp: VeilidConfigTCP, + pub ws: VeilidConfigWS, + pub wss: VeilidConfigWSS, +} + +#[derive(Debug, Default, Clone)] +pub struct VeilidConfigDHT { + pub resolve_node_timeout: Option, + pub resolve_node_count: u32, + pub resolve_node_fanout: u32, + pub max_find_node_count: u32, + pub get_value_timeout: Option, + pub get_value_count: u32, + pub get_value_fanout: u32, + pub set_value_timeout: Option, + pub set_value_count: u32, + pub set_value_fanout: u32, + pub min_peer_count: u32, + pub min_peer_refresh_time: u64, + pub validate_dial_info_receipt_time: u64, +} + +#[derive(Debug, Default, Clone)] +pub struct VeilidConfigRPC { + pub concurrency: u32, + pub queue_size: u32, + pub max_timestamp_behind: Option, + pub max_timestamp_ahead: Option, + pub timeout: u64, + pub max_route_hop_count: u8, +} + +#[derive(Debug, Default, Clone)] +pub struct VeilidConfigLeases { + pub max_server_signal_leases: u32, + pub max_server_relay_leases: u32, + pub max_client_signal_leases: u32, + pub max_client_relay_leases: u32, +} + +#[derive(Debug, Default, Clone)] +pub struct VeilidConfigNetwork { + pub max_connections: u32, + pub connection_initial_timeout: u64, + pub node_id: key::DHTKey, + pub node_id_secret: key::DHTKeySecret, + pub bootstrap: Vec, + pub rpc: VeilidConfigRPC, + pub dht: VeilidConfigDHT, + pub upnp: bool, + pub natpmp: bool, + pub enable_local_peer_scope: bool, + pub restricted_nat_retries: u32, + pub tls: VeilidConfigTLS, + pub protocol: VeilidConfigProtocol, + pub leases: VeilidConfigLeases, +} + +#[derive(Default, Clone)] +pub struct VeilidConfigTableStore { + pub directory: String, +} + +#[derive(Default, Clone)] +pub struct VeilidConfigProtectedStore { + pub allow_insecure_fallback: bool, + pub always_use_insecure_storage: bool, + pub insecure_fallback_directory: String, +} + +#[derive(Default, Clone)] +pub struct VeilidConfigCapabilities { + pub protocol_udp: bool, + pub protocol_connect_tcp: bool, + pub protocol_accept_tcp: bool, + pub protocol_connect_ws: bool, + pub protocol_accept_ws: bool, + pub protocol_connect_wss: bool, + pub protocol_accept_wss: bool, +} + +#[derive(Default, Clone)] +pub struct VeilidConfig { + pub program_name: String, + pub namespace: String, + pub capabilities: VeilidConfigCapabilities, + pub protected_store: VeilidConfigProtectedStore, + pub table_store: VeilidConfigTableStore, + pub network: VeilidConfigNetwork, +} + +///////////////////////////////////////// + + +///////////////////////////////////////// + +#[derive(Debug)] +pub enum APIErrorKind { + AlreadyInitialized, + NotInitialized, + InvalidConfig, + Timeout, + Shutdown, + NodeNotFound(String), + NoDialInfo(String), + Internal(String), + Unimplemented(String), + ParseError { + message: String, + value: String, + }, + InvalidArgument { + context: String, + argument: String, + value: String, + }, + MissingArgument { + context: String, + argument: String, + }, +} + +#[derive(Debug)] +pub struct VeilidAPIError { + kind: APIErrorKind, + message: String, +} + +#[derive(Debug)] +pub enum AttachmentState { + Detached, + Attaching, + AttachedWeak, + AttachedGood, + AttachedStrong, + FullyAttached, + OverAttached, + 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. +} + +pub fn get_veilid_state() -> Result { + +} + +// xxx api functions + +pub fn shutdown_veilid_core() -> Result<(), VeilidAPIError> { + +} diff --git a/veilid-flutter/rust/src/lib.rs b/veilid-flutter/rust/src/lib.rs new file mode 100644 index 00000000..dfdd872c --- /dev/null +++ b/veilid-flutter/rust/src/lib.rs @@ -0,0 +1,2 @@ +mod api; +mod bridge_generated; diff --git a/veilid-server/proto/veilid-client.capnp b/veilid-server/proto/veilid-client.capnp index bead2659..facac702 100644 --- a/veilid-server/proto/veilid-client.capnp +++ b/veilid-server/proto/veilid-client.capnp @@ -11,21 +11,19 @@ enum AttachmentState { detaching @7; } +struct Attachment { + state @0 :AttachmentState; +} + +struct VeilidUpdate { + union { + attachment @0 :Attachment; + dummy @1 :Void; + } +} + struct VeilidState { -# union { - attachment @0 :AttachmentState; -# } -} - -struct AttachmentStateChange { - oldState @0 :AttachmentState; - newState @1 :AttachmentState; -} - -struct VeilidStateChange { -# union { - attachment @0 :AttachmentStateChange; -# } + attachment @0 :Attachment; } interface Registration {} @@ -33,18 +31,17 @@ interface Registration {} interface VeilidServer { register @0 (veilidClient: VeilidClient) -> (registration: Registration); + debug @1 (what: Text) -> (output: Text); - attach @1 (); - detach @2 (); - shutdown @3 (); - - debug @4 (what: Text) -> (output: Text); - + attach @2 (); + detach @3 (); + shutdown @4 (); + getState @5 () -> (state: VeilidState); } interface VeilidClient { - stateChanged @0 (changed: VeilidStateChange); + update @0 (veilidUpdate: VeilidUpdate); logMessage @1 (message: Text); } \ No newline at end of file diff --git a/veilid-server/src/client_api.rs b/veilid-server/src/client_api.rs index 20b3a3b1..5984dae7 100644 --- a/veilid-server/src/client_api.rs +++ b/veilid-server/src/client_api.rs @@ -17,6 +17,40 @@ use veilid_core::xx::Eventual; #[fail(display = "Client API error: {}", _0)] pub struct ClientAPIError(String); +fn convert_attachment_state(state: &veilid_core::AttachmentState) -> AttachmentState { + match 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, + } +} + +fn convert_update( + update: &veilid_core::VeilidUpdate, + rpc_update: crate::veilid_client_capnp::veilid_update::Builder, +) { + match update { + veilid_core::VeilidUpdate::Attachment(state) => { + let mut att = rpc_update.init_attachment(); + att.set_state(convert_attachment_state(state)); + } + } +} + +fn convert_state( + state: &veilid_core::VeilidState, + rpc_state: crate::veilid_client_capnp::veilid_state::Builder, +) { + rpc_state + .init_attachment() + .set_state(convert_attachment_state(&state.attachment)); +} + // --- interface Registration --------------------------------- struct RegistrationHandle { @@ -104,13 +138,25 @@ impl veilid_server::Server for VeilidServerImpl { self.next_id += 1; - // Send state update + Promise::ok(()) + } + + fn debug( + &mut self, + params: veilid_server::DebugParams, + mut results: veilid_server::DebugResults, + ) -> Promise<(), ::capnp::Error> { + trace!("VeilidServerImpl::debug"); let veilid_api = self.veilid_api.clone(); + let what = pry!(pry!(params.get()).get_what()).to_owned(); + Promise::from_future(async move { - veilid_api - .send_state_update() + let output = veilid_api + .debug(what) .await - .map_err(|e| ::capnp::Error::failed(format!("{:?}", e))) + .map_err(|e| ::capnp::Error::failed(format!("{:?}", e)))?; + results.get().set_output(output.as_str()); + Ok(()) }) } @@ -128,6 +174,7 @@ impl veilid_server::Server for VeilidServerImpl { .map_err(|e| ::capnp::Error::failed(format!("{:?}", e))) }) } + fn detach( &mut self, _params: veilid_server::DetachParams, @@ -142,6 +189,7 @@ impl veilid_server::Server for VeilidServerImpl { .map_err(|e| ::capnp::Error::failed(format!("{:?}", e))) }) } + fn shutdown( &mut self, _params: veilid_server::ShutdownParams, @@ -161,21 +209,21 @@ impl veilid_server::Server for VeilidServerImpl { Promise::ok(()) } - fn debug( + fn get_state( &mut self, - params: veilid_server::DebugParams, - mut results: veilid_server::DebugResults, + _params: veilid_server::GetStateParams, + mut results: veilid_server::GetStateResults, ) -> Promise<(), ::capnp::Error> { - trace!("VeilidServerImpl::debug"); + trace!("VeilidServerImpl::get_state"); let veilid_api = self.veilid_api.clone(); - let what = pry!(pry!(params.get()).get_what()).to_owned(); - Promise::from_future(async move { - let output = veilid_api - .debug(what) + let state = veilid_api + .get_state() .await .map_err(|e| ::capnp::Error::failed(format!("{:?}", e)))?; - results.get().set_output(output.as_str()); + + let rpc_state = results.get().init_state(); + convert_state(&state, rpc_state); Ok(()) }) } @@ -260,35 +308,6 @@ impl ClientApi { incoming_loop.await } - fn convert_attachment_state(state: &veilid_core::AttachmentState) -> AttachmentState { - match 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, - } - } - - fn convert_state_changed( - changed: &veilid_core::VeilidStateChange, - rpc_changed: crate::veilid_client_capnp::veilid_state_change::Builder, - ) { - match changed { - veilid_core::VeilidStateChange::Attachment { - old_state, - new_state, - } => { - let mut att = rpc_changed.init_attachment(); - att.set_old_state(ClientApi::convert_attachment_state(old_state)); - att.set_new_state(ClientApi::convert_attachment_state(new_state)); - } - } - } - fn send_request_to_all_clients(self: Rc, request: F) where F: Fn(u64, &mut RegistrationHandle) -> ::capnp::capability::RemotePromise, @@ -326,11 +345,11 @@ impl ClientApi { } } - pub fn handle_state_change(self: Rc, changed: veilid_core::VeilidStateChange) { + pub fn handle_update(self: Rc, veilid_update: veilid_core::VeilidUpdate) { self.send_request_to_all_clients(|_id, registration| { - let mut request = registration.client.state_changed_request(); - let rpc_changed = request.get().init_changed(); - ClientApi::convert_state_changed(&changed, rpc_changed); + let mut request = registration.client.update_request(); + let rpc_veilid_update = request.get().init_veilid_update(); + convert_update(&veilid_update, rpc_veilid_update); request.send() }); } diff --git a/veilid-server/src/server.rs b/veilid-server/src/server.rs index e260f5fd..8d187d14 100644 --- a/veilid-server/src/server.rs +++ b/veilid-server/src/server.rs @@ -29,18 +29,18 @@ pub async fn run_veilid_server(settings: Settings, logs: VeilidLogs) -> Result<( // Create client api state change pipe let (sender, receiver): ( - Sender, - Receiver, + Sender, + Receiver, ) = bounded(1); // Create VeilidCore setup let vcs = veilid_core::VeilidCoreSetup { - state_change_callback: Arc::new( - move |change: veilid_core::VeilidStateChange| -> veilid_core::SystemPinBoxFuture<()> { + update_callback: Arc::new( + move |change: veilid_core::VeilidUpdate| -> veilid_core::SystemPinBoxFuture<()> { let sender = sender.clone(); Box::pin(async move { if sender.send(change).await.is_err() { - error!("error sending state change callback"); + error!("error sending veilid update callback"); } }) }, @@ -70,10 +70,10 @@ pub async fn run_veilid_server(settings: Settings, logs: VeilidLogs) -> Result<( drop(settingsr); // Handle state changes on main thread for capnproto rpc - let state_change_receiver_jh = capi.clone().map(|capi| { + let update_receiver_jh = capi.clone().map(|capi| { async_std::task::spawn_local(async move { while let Ok(change) = receiver.recv().await { - capi.clone().handle_state_change(change); + capi.clone().handle_update(change); } }) }); @@ -147,9 +147,9 @@ pub async fn run_veilid_server(settings: Settings, logs: VeilidLogs) -> Result<( client_log_channel_closer.close(); } - // Wait for state change receiver to exit - if let Some(state_change_receiver_jh) = state_change_receiver_jh { - state_change_receiver_jh.await; + // Wait for update receiver to exit + if let Some(update_receiver_jh) = update_receiver_jh { + update_receiver_jh.await; } // Wait for client api log receiver to exit diff --git a/veilid-wasm/.appveyor.yml b/veilid-wasm/.appveyor.yml deleted file mode 100644 index 50910bd6..00000000 --- a/veilid-wasm/.appveyor.yml +++ /dev/null @@ -1,11 +0,0 @@ -install: - - appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe - - if not defined RUSTFLAGS rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly - - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin - - rustc -V - - cargo -V - -build: false - -test_script: - - cargo test --locked diff --git a/veilid-wasm/.cargo-ok b/veilid-wasm/.cargo-ok deleted file mode 100644 index e69de29b..00000000 diff --git a/veilid-wasm/.gitignore b/veilid-wasm/.gitignore deleted file mode 100644 index 1711838e..00000000 --- a/veilid-wasm/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/target -**/*.rs.bk -bin/ -pkg/ -wasm-pack.log diff --git a/veilid-wasm/.travis.yml b/veilid-wasm/.travis.yml deleted file mode 100644 index 7a913256..00000000 --- a/veilid-wasm/.travis.yml +++ /dev/null @@ -1,69 +0,0 @@ -language: rust -sudo: false - -cache: cargo - -matrix: - include: - - # Builds with wasm-pack. - - rust: beta - env: RUST_BACKTRACE=1 - addons: - firefox: latest - chrome: stable - before_script: - - (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update) - - (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "^0.2" cargo-generate) - - cargo install-update -a - - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -f - script: - - cargo generate --git . --name testing - # Having a broken Cargo.toml (in that it has curlies in fields) anywhere - # in any of our parent dirs is problematic. - - mv Cargo.toml Cargo.toml.tmpl - - cd testing - - wasm-pack build - - wasm-pack test --chrome --firefox --headless - - # Builds on nightly. - - rust: nightly - env: RUST_BACKTRACE=1 - before_script: - - (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update) - - (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "^0.2" cargo-generate) - - cargo install-update -a - - rustup target add wasm32-unknown-unknown - script: - - cargo generate --git . --name testing - - mv Cargo.toml Cargo.toml.tmpl - - cd testing - - cargo check - - cargo check --target wasm32-unknown-unknown - - cargo check --no-default-features - - cargo check --target wasm32-unknown-unknown --no-default-features - - cargo check --no-default-features --features console_error_panic_hook - - cargo check --target wasm32-unknown-unknown --no-default-features --features console_error_panic_hook - - cargo check --no-default-features --features "console_error_panic_hook wee_alloc" - - cargo check --target wasm32-unknown-unknown --no-default-features --features "console_error_panic_hook wee_alloc" - - # Builds on beta. - - rust: beta - env: RUST_BACKTRACE=1 - before_script: - - (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update) - - (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "^0.2" cargo-generate) - - cargo install-update -a - - rustup target add wasm32-unknown-unknown - script: - - cargo generate --git . --name testing - - mv Cargo.toml Cargo.toml.tmpl - - cd testing - - cargo check - - cargo check --target wasm32-unknown-unknown - - cargo check --no-default-features - - cargo check --target wasm32-unknown-unknown --no-default-features - - cargo check --no-default-features --features console_error_panic_hook - - cargo check --target wasm32-unknown-unknown --no-default-features --features console_error_panic_hook - # Note: no enabling the `wee_alloc` feature here because it requires - # nightly for now. diff --git a/veilid-wasm/Cargo.lock b/veilid-wasm/Cargo.lock deleted file mode 100644 index 1d405e44..00000000 --- a/veilid-wasm/Cargo.lock +++ /dev/null @@ -1,2868 +0,0 @@ -# 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.3", - "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 = "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.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d9ff5d688f1c13395289f67db01d4826b46dd694e7580accdc3e8430f2d98e" - -[[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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d06e9a20f1c0d64b6067ef6aa9fdf59e194ecde93575591fb4c78063692324" -dependencies = [ - "async-std", - "async-tls", - "futures-io", - "futures-util", - "log", - "pin-project-lite", - "tungstenite", -] - -[[package]] -name = "async_executors" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b13b311cd10e80105651ad640a6741991d147787badb4141e8e1b7fd59816f5" -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-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.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "526c210b4520e416420759af363083471656e819a75e831b8d2c9d5a584f2413" -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 = "bumpalo" -version = "3.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" - -[[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.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" - -[[package]] -name = "capnp" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9b8a7119420b5279ddc2b4ee553ee15bcf4605df6135a26f03ffe153bee97c" - -[[package]] -name = "capnpc" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47bce811162518b5c38f746ed584bd2922ae7bb560ef64f230d2e4ee0d111fe" -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.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b72a433d0cf2aef113ba70f62634c56fddb0f244e6377185c56a7cadbd8f91" -dependencies = [ - "cfg-if 1.0.0", - "cipher 0.3.0", - "cpufeatures", - "zeroize", -] - -[[package]] -name = "chacha20poly1305" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b84ed6d1d5f7aa9bdde921a5090e0ca4d934d250ea3b402a5fab3a994e28a2a" -dependencies = [ - "aead", - "chacha20", - "cipher 0.3.0", - "poly1305", - "zeroize", -] - -[[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.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b2f5d0ee456f3928812dfc8c6d9a1d592b98678f6d56db9b0cd2b7bc6c8db5" -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.130", - "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.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" -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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" -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 = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7" -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.130", -] - -[[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.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b394ed3d285a429378d3b384b9eb1285267e7df4b166df24b7a6939a04dc392e" -dependencies = [ - "instant", -] - -[[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 = "futures" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" - -[[package]] -name = "futures-executor" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" - -[[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.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" -dependencies = [ - "autocfg", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" - -[[package]] -name = "futures-task" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" - -[[package]] -name = "futures-util" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" -dependencies = [ - "autocfg", - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "proc-macro-hack", - "proc-macro-nested", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" -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.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" -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.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f" -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 = "hashlink" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" -dependencies = [ - "hashbrown", -] - -[[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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" -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 = "if-addrs" -version = "0.6.7" -dependencies = [ - "if-addrs-sys", - "libc", - "winapi", -] - -[[package]] -name = "if-addrs-sys" -version = "0.3.2" -dependencies = [ - "cc", - "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 = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[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.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" -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" -version = "0.10.1" -dependencies = [ - "byteorder", - "cfg-if 0.1.10", - "core-foundation 0.9.2", - "core-foundation-sys 0.8.3", - "jni", - "keychain-services", - "lazy_static", - "log", - "ndk", - "ndk-glue", - "secret-service", - "security-framework", - "security-framework-sys", - "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.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119" - -[[package]] -name = "libsqlite3-sys" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abd5850c449b40bacb498b2bbdfaff648b1b055630073ba8db499caf2d0ea9f2" -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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c748cfe47cb8da225c37595b3108bea1c198c84aaae8ea0ba76d01dda9fc803" -dependencies = [ - "hashbrown", -] - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" -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.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" -dependencies = [ - "bitflags", - "jni-sys", - "ndk-sys", - "num_enum", - "thiserror", -] - -[[package]] -name = "ndk-glue" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc291b8de2095cba8dab7cf381bf582ff4c17a09acf854c32e46545b08085d28" -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.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" - -[[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 = "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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" -dependencies = [ - "derivative", - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" -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.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" - -[[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 = "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.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" - -[[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.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f" - -[[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", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" - -[[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-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" - -[[package]] -name = "proc-macro2" -version = "1.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" -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.3", -] - -[[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.3", - "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 = "rusqlite" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a82b0b91fad72160c56bf8da7a549b25d7c31109f52cc1437eac4c0ad2550a7" -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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[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.130", - "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.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" -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.130" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" -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.130", - "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.130", -] - -[[package]] -name = "serde_derive" -version = "1.0.130" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063bf466a64011ac24040a49009724ee60a57da1b437617ceb32e53ad61bfb19" -dependencies = [ - "itoa", - "ryu", - "serde 1.0.130", -] - -[[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", - "digest", - "opaque-debug", -] - -[[package]] -name = "sha2" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" -dependencies = [ - "block-buffer", - "cfg-if 1.0.0", - "cpufeatures", - "digest", - "opaque-debug", -] - -[[package]] -name = "signal-hook" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c98891d737e271a2954825ef19e46bd16bdb98e2746f2eec4f7a4ef7946efd1" -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.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" - -[[package]] -name = "slab" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" - -[[package]] -name = "smallvec" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" - -[[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.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" -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 = "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 = "toml" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" -dependencies = [ - "serde 1.0.130", -] - -[[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.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" - -[[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 = "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-std", - "async-tls", - "async-tungstenite", - "async_executors", - "backtrace", - "blake3", - "capnp", - "capnpc", - "cfg-if 0.1.10", - "chacha20poly1305", - "config", - "console_error_panic_hook", - "curve25519-dalek-ng", - "data-encoding", - "digest", - "directories", - "ed25519-dalek", - "futures-util", - "generic-array", - "getrandom 0.2.3", - "hashbrown", - "hex", - "if-addrs", - "jni", - "jni-sys", - "js-sys", - "keyring", - "keyvaluedb-sqlite", - "keyvaluedb-web", - "lazy_static", - "log", - "lru", - "maplit", - "ndk", - "ndk-glue", - "no-std-net", - "num_cpus", - "once_cell", - "parking_lot", - "rand 0.7.3", - "rusqlite", - "rust-fsm", - "rustls", - "rustls-pemfile", - "secrecy", - "serde 1.0.130", - "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.1", - "wee_alloc", - "ws_stream_wasm", - "x25519-dalek-ng", -] - -[[package]] -name = "veilid-wasm" -version = "0.1.0" -dependencies = [ - "cfg-if 1.0.0", - "console_error_panic_hook", - "js-sys", - "log", - "veilid-core", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test", - "wasm-logger", - "wee_alloc", -] - -[[package]] -name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[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.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" - -[[package]] -name = "wasm-bindgen-test" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96f1aa7971fdf61ef0f353602102dbea75a56e225ed036c1e3740564b91e6b7e" -dependencies = [ - "console_error_panic_hook", - "js-sys", - "scoped-tls", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test-macro", -] - -[[package]] -name = "wasm-bindgen-test-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6006f79628dfeb96a86d4db51fbf1344cd7fd8408f06fc9aa3c84913a4789688" -dependencies = [ - "proc-macro2", - "quote", -] - -[[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.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" -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.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c475786c6f47219345717a043a37ec04cb4bc185e28853adcc4fa0a947eba630" -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", - "once_cell", - "polling", - "scoped-tls", - "serde 1.0.130", - "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.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73" -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.130", - "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-wasm/Cargo.toml b/veilid-wasm/Cargo.toml deleted file mode 100644 index 2cdce744..00000000 --- a/veilid-wasm/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "veilid-wasm" -version = "0.1.0" -authors = ["John Smith "] -edition = "2018" -license = "LGPL-2.0-or-later OR MPL-2.0 OR (MIT AND BSD-3-Clause)" - -[lib] -crate-type = ["cdylib", "rlib"] - -[dependencies] -wasm-bindgen = "^0" -console_error_panic_hook = "^0" -wee_alloc = "^0" -wasm-logger = "^0" -log = "^0" -veilid-core = { path = "../veilid-core" } -cfg-if = "^1" -wasm-bindgen-futures = "^0" -js-sys = "^0" - -[dev-dependencies] -wasm-bindgen-test = "^0" - -[profile.release] -# Tell `rustc` to optimize for small code size. -opt-level = "s" diff --git a/veilid-wasm/LICENSE_APACHE b/veilid-wasm/LICENSE_APACHE deleted file mode 100644 index 1b5ec8b7..00000000 --- a/veilid-wasm/LICENSE_APACHE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS diff --git a/veilid-wasm/LICENSE_MIT b/veilid-wasm/LICENSE_MIT deleted file mode 100644 index d17aa8d3..00000000 --- a/veilid-wasm/LICENSE_MIT +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2018 John Smith - -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/veilid-wasm/README.md b/veilid-wasm/README.md deleted file mode 100644 index 1e4617a6..00000000 --- a/veilid-wasm/README.md +++ /dev/null @@ -1,69 +0,0 @@ -
- -

wasm-pack-template

- - A template for kick starting a Rust and WebAssembly project using wasm-pack. - -

- Build Status -

- -

- Tutorial - | - Chat -

- - Built with 🦀🕸 by The Rust and WebAssembly Working Group -
- -## About - -[**📚 Read this template tutorial! 📚**][template-docs] - -This template is designed for compiling Rust libraries into WebAssembly and -publishing the resulting package to NPM. - -Be sure to check out [other `wasm-pack` tutorials online][tutorials] for other -templates and usages of `wasm-pack`. - -[tutorials]: https://rustwasm.github.io/docs/wasm-pack/tutorials/index.html -[template-docs]: https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html - -## 🚴 Usage - -### 🐑 Use `cargo generate` to Clone this Template - -[Learn more about `cargo generate` here.](https://github.com/ashleygwilliams/cargo-generate) - -``` -cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project -cd my-project -``` - -### 🛠️ Build with `wasm-pack build` - -``` -wasm-pack build -``` - -### 🔬 Test in Headless Browsers with `wasm-pack test` - -``` -wasm-pack test --headless --firefox -``` - -### 🎁 Publish to NPM with `wasm-pack publish` - -``` -wasm-pack publish -``` - -## 🔋 Batteries Included - -* [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) for communicating - between WebAssembly and JavaScript. -* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook) - for logging panic messages to the developer console. -* [`wee_alloc`](https://github.com/rustwasm/wee_alloc), an allocator optimized - for small code size. diff --git a/veilid-wasm/src/js_veilid_core.rs b/veilid-wasm/src/js_veilid_core.rs deleted file mode 100644 index f83de15f..00000000 --- a/veilid-wasm/src/js_veilid_core.rs +++ /dev/null @@ -1,289 +0,0 @@ -use crate::*; -pub use wasm_bindgen_futures::*; - -#[wasm_bindgen(js_name = VeilidStateChange)] -pub struct JsVeilidStateChange { - kind: String, // "attachment" => AttachmentState(String) - from: JsValue, - to: JsValue, -} -#[wasm_bindgen(js_name = VeilidState)] -pub struct JsVeilidState { - kind: String, // "attachment" => AttachmentState(String) - state: JsValue, -} - -#[wasm_bindgen(js_name = VeilidCore)] -pub struct JsVeilidCore { - core: VeilidCore, -} - -#[wasm_bindgen(js_class = VeilidCore)] -impl JsVeilidCore { - #[wasm_bindgen(constructor)] - pub fn new() -> Self { - set_panic_hook(); - JsVeilidCore { - core: VeilidCore::new(), - } - } - fn value_to_string(val: JsValue) -> Result, ()> { - Ok(Box::new(val.as_string().ok_or(())?)) - } - fn value_to_option_string(val: JsValue) -> Result, ()> { - if val.is_null() || val.is_undefined() { - return Ok(Box::new(Option::::None)); - } - Ok(Box::new(Some(val.as_string().ok_or(())?))) - } - fn value_to_bool(val: JsValue) -> Result, ()> { - Ok(Box::new(val.is_truthy())) - } - fn value_to_u8(val: JsValue) -> Result, ()> { - Ok(Box::new(f64_try_to_unsigned::( - val.as_f64().ok_or(())?, - )?)) - } - fn value_to_u32(val: JsValue) -> Result, ()> { - Ok(Box::new(f64_try_to_unsigned::( - val.as_f64().ok_or(())?, - )?)) - } - fn value_to_u64(val: JsValue) -> Result, ()> { - Ok(Box::new(f64_try_to_unsigned::( - val.as_f64().ok_or(())?, - )?)) - } - fn value_to_option_u64(val: JsValue) -> Result, ()> { - if val.is_null() || val.is_undefined() { - return Ok(Box::new(Option::::None)); - } - - Ok(Box::new(Some(f64_try_to_unsigned::( - val.as_f64().ok_or(())?, - )?))) - } - fn value_to_dht_key(val: JsValue) -> Result, ()> { - Ok(Box::new( - DHTKey::try_decode(val.as_string().ok_or(())?.as_str()).map_err(drop)?, - )) - } - fn value_to_dht_key_secret(val: JsValue) -> Result, ()> { - Ok(Box::new( - DHTKeySecret::try_decode(val.as_string().ok_or(())?.as_str()).map_err(drop)?, - )) - } - fn value_to_vec_string(val: JsValue) -> Result, ()> { - let arrval = val.dyn_into::().map_err(drop)?.to_vec(); - let mut out = Vec::::with_capacity(arrval.len()); - for v in arrval { - out.push(v.as_string().ok_or(())?); - } - Ok(Box::new(out)) - } - - fn translate_config_callback(key: &str, val: JsValue) -> Result, ()> { - match key { - // xxx: lots of missing keys here - "namespace" => Self::value_to_string(val), - "capabilities.protocol_udp" => Self::value_to_bool(val), - "capabilities.protocol_connect_tcp" => Self::value_to_bool(val), - "capabilities.protocol_accept_tcp" => Self::value_to_bool(val), - "capabilities.protocol_connect_ws" => Self::value_to_bool(val), - "capabilities.protocol_accept_ws" => Self::value_to_bool(val), - "capabilities.protocol_connect_wss" => Self::value_to_bool(val), - "capabilities.protocol_accept_wss" => Self::value_to_bool(val), - "table_store.directory" => Self::value_to_string(val), - "protected_store.allow_insecure_fallback" => Self::value_to_bool(val), - "protected_store.always_use_insecure_storage" => Self::value_to_bool(val), - "protected_store.insecure_fallback_directory" => Self::value_to_string(val), - "network.max_connections" => Self::value_to_u32(val), - "network.node_id" => Self::value_to_dht_key(val), - "network.node_id_secret" => Self::value_to_dht_key_secret(val), - "network.bootstrap" => Self::value_to_vec_string(val), - "network.rpc.concurrency" => Self::value_to_u32(val), - "network.rpc.queue_size" => Self::value_to_u32(val), - "network.rpc.max_timestamp_behind" => Self::value_to_option_u64(val), - "network.rpc.max_timestamp_ahead" => Self::value_to_option_u64(val), - "network.rpc.timeout" => Self::value_to_u64(val), - "network.rpc.max_route_hop_count" => Self::value_to_u8(val), - "network.dht.resolve_node_timeout" => Self::value_to_option_u64(val), - "network.dht.resolve_node_count" => Self::value_to_u32(val), - "network.dht.resolve_node_fanout" => Self::value_to_u32(val), - "network.dht.max_find_node_count" => Self::value_to_u32(val), - "network.dht.get_value_timeout" => Self::value_to_option_u64(val), - "network.dht.get_value_count" => Self::value_to_u32(val), - "network.dht.get_value_fanout" => Self::value_to_u32(val), - "network.dht.set_value_timeout" => Self::value_to_option_u64(val), - "network.dht.set_value_count" => Self::value_to_u32(val), - "network.dht.set_value_fanout" => Self::value_to_u32(val), - "network.dht.min_peer_count" => Self::value_to_u32(val), - "network.dht.min_peer_refresh_time" => Self::value_to_u64(val), - "network.dht.validate_dial_info_receipt_time" => Self::value_to_u64(val), - "network.upnp" => Self::value_to_bool(val), - "network.natpmp" => Self::value_to_bool(val), - "network.enable_local_peer_scope" => Self::value_to_bool(val), - "network.restricted_nat_retries" => Self::value_to_u32(val), - "network.tls.certificate_path" => Self::value_to_string(val), - "network.tls.private_key_path" => Self::value_to_string(val), - "network.application.path" => Self::value_to_string(val), - "network.application.https.enabled" => Self::value_to_bool(val), - "network.application.https.listen_address" => Self::value_to_string(val), - "network.application.http.enabled" => Self::value_to_bool(val), - "network.application.http.listen_address" => Self::value_to_string(val), - "network.protocol.udp.enabled" => Self::value_to_bool(val), - "network.protocol.udp.socket_pool_size" => Self::value_to_u32(val), - "network.protocol.udp.listen_address" => Self::value_to_string(val), - "network.protocol.udp.public_address" => Self::value_to_option_string(val), - "network.protocol.tcp.connect" => Self::value_to_bool(val), - "network.protocol.tcp.listen" => Self::value_to_bool(val), - "network.protocol.tcp.max_connections" => Self::value_to_u32(val), - "network.protocol.tcp.listen_address" => Self::value_to_string(val), - "network.protocol.tcp.public_address" => Self::value_to_option_string(val), - "network.protocol.ws.connect" => Self::value_to_bool(val), - "network.protocol.ws.listen" => Self::value_to_bool(val), - "network.protocol.ws.max_connections" => Self::value_to_u32(val), - "network.protocol.ws.listen_address" => Self::value_to_string(val), - "network.protocol.ws.path" => Self::value_to_string(val), - "network.protocol.ws.public_address" => Self::value_to_option_string(val), - "network.protocol.wss.connect" => Self::value_to_bool(val), - "network.protocol.wss.listen" => Self::value_to_bool(val), - "network.protocol.wss.max_connections" => Self::value_to_u32(val), - "network.protocol.wss.listen_address" => Self::value_to_string(val), - "network.protocol.wss.path" => Self::value_to_string(val), - "network.protocol.wss.public_address" => Self::value_to_option_string(val), - _ => return Err(()), - } - } - fn translate_veilid_state(state: JsVeilidState) -> Result { - Ok(match state.kind.as_str() { - "attachment" => { - let state_string = state - .state - .as_string() - .ok_or(JsValue::from_str("state should be a string"))?; - let astate = AttachmentState::try_from(state_string) - .map_err(|e| JsValue::from_str(format!("invalid state: {:?}", e).as_str()))?; - VeilidState::Attachment(astate) - } - _ => return Err(JsValue::from_str("unknown state kind")), - }) - } - // xxx rework this for new veilid_api mechanism which should be its own js object now - pub fn startup( - &self, - js_state_change_callback: Function, - js_config_callback: Function, - ) -> Promise { - let core = self.core.clone(); - future_to_promise(async move { - let vcs = VeilidCoreSetup { - state_change_callback: Arc::new( - move |change: VeilidStateChange| -> SystemPinBoxFuture<()> { - let js_state_change_callback = js_state_change_callback.clone(); - Box::pin(async move { - let js_change = match change { - VeilidStateChange::Attachment { - old_state, - new_state, - } => JsVeilidStateChange { - kind: "attachment".to_owned(), - from: JsValue::from_str(old_state.to_string().as_str()), - to: JsValue::from_str(new_state.to_string().as_str()), - }, - }; - - let ret = match Function::call1( - &js_state_change_callback, - &JsValue::UNDEFINED, - &JsValue::from(js_change), - ) { - Ok(v) => v, - Err(e) => { - error!("calling state change callback failed: {:?}", e); - return; - } - }; - let retp: Promise = match ret.dyn_into() { - Ok(v) => v, - Err(e) => { - error!( - "state change callback did not return a promise: {:?}", - e - ); - return; - } - }; - match JsFuture::from(retp).await { - Ok(_) => (), - Err(e) => { - error!("state change callback returned an error: {:?}", e); - return; - } - }; - }) - }, - ), - config_callback: Arc::new( - move |key: String| -> Result, String> { - let val = Function::call1( - &js_config_callback, - &JsValue::UNDEFINED, - &JsValue::from_str(key.as_str()), - ) - .map_err(|_| { - format!("Failed to get config from callback for key '{}'", key) - })?; - - Self::translate_config_callback(key.as_str(), val) - .map_err(|_| format!("invalid value type for config key '{}'", key)) - }, - ), - }; - - match core.startup(vcs).await { - Ok(_) => Ok(JsValue::UNDEFINED), - Err(e) => Err(JsValue::from_str( - format!("VeilidCore startup() failed: {}", e.to_string()).as_str(), - )), - } - }) - } - - pub fn send_state_update(&self) { - self.core.send_state_update(); - } - - pub fn shutdown(&self) -> Promise { - let core = self.core.clone(); - future_to_promise(async move { - core.shutdown().await; - Ok(JsValue::UNDEFINED) - }) - } - - pub fn attach(&self) -> Promise { - let core = self.core.clone(); - future_to_promise(async move { - core.attach(); - Ok(JsValue::UNDEFINED) - }) - } - - pub fn detach(&self) -> Promise { - let core = self.core.clone(); - future_to_promise(async move { - core.detach(); - Ok(JsValue::UNDEFINED) - }) - } - - pub fn wait_for_state(&self, state: JsVeilidState) -> Promise { - let core = self.core.clone(); - future_to_promise(async move { - let state = Self::translate_veilid_state(state)?; - core.wait_for_state(state).await; - Ok(JsValue::UNDEFINED) - }) - } -} diff --git a/veilid-wasm/src/lib.rs b/veilid-wasm/src/lib.rs deleted file mode 100644 index 86e8a845..00000000 --- a/veilid-wasm/src/lib.rs +++ /dev/null @@ -1,25 +0,0 @@ -#![cfg(target_arch = "wasm32")] -#![no_std] - -#[macro_use] -extern crate alloc; - -pub use log::*; -pub use wasm_bindgen::prelude::*; -pub use wasm_bindgen::JsCast; - -pub use alloc::boxed::Box; -pub use alloc::string::String; -pub use alloc::sync::Arc; -pub use alloc::vec::Vec; -pub use core::convert::TryFrom; -pub use js_sys::*; -pub use js_veilid_core::*; -pub use utils::*; -pub use veilid_core::dht::key::*; -pub use veilid_core::xx::*; -pub use veilid_core::*; -pub use wasm_logger::*; - -mod js_veilid_core; -mod utils; diff --git a/veilid-wasm/src/utils.rs b/veilid-wasm/src/utils.rs deleted file mode 100644 index f412aa97..00000000 --- a/veilid-wasm/src/utils.rs +++ /dev/null @@ -1,38 +0,0 @@ -#![cfg(target_arch = "wasm32")] -use cfg_if::*; -use wasm_bindgen::prelude::*; -//use wasm_bindgen_futures::*; - -cfg_if! { - if #[cfg(feature = "wee_alloc")] { - // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global - // allocator. - extern crate wee_alloc; - #[global_allocator] - static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; - } -} - -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(js_namespace = console, js_name = log)] - pub fn console_log(s: &str); - - #[wasm_bindgen] - pub fn alert(s: &str); -} - -pub fn set_panic_hook() { - #[cfg(feature = "console_error_panic_hook")] - console_error_panic_hook::set_once(); -} - -pub fn f64_try_to_unsigned(f: f64) -> Result -where T: core::convert::TryFrom -{ - let rf = f.floor(); - if rf < 0.0 { - return Err(()); - } - T::try_from(rf as u64).map_err(drop) -} \ No newline at end of file diff --git a/veilid-wasm/tests/web.rs b/veilid-wasm/tests/web.rs deleted file mode 100644 index 8b933b75..00000000 --- a/veilid-wasm/tests/web.rs +++ /dev/null @@ -1,182 +0,0 @@ -//! Test suite for the Web and headless browsers. -#![cfg(target_arch = "wasm32")] - -extern crate alloc; -extern crate wasm_bindgen_test; -use core::sync::atomic::AtomicBool; -use veilid_wasm::*; -use wasm_bindgen_test::*; - -wasm_bindgen_test_configure!(run_in_browser); - -static SETUP_ONCE: AtomicBool = AtomicBool::new(false); -pub fn setup() -> () { - if SETUP_ONCE - .compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed) - .is_ok() - { - console_log("setup()"); - console_error_panic_hook::set_once(); - wasm_logger::init(wasm_logger::Config::new(Level::Trace)); - init_callbacks(); - } -} -// xxx needs updating to new keys and veilid_api object -fn init_callbacks() { - assert_eq!(js_sys::eval(r#" - window.sleep = (milliseconds) => { return new Promise(resolve => setTimeout(resolve, milliseconds)) }; - window.stateChangeCallback = async (stateChange) => { console.log("State change: " + stateChange); }; - window.configCallback = (configKey) => { - switch(configKey) { - case "namespace": return ""; - case "capabilities.protocol_udp": return false; - case "capabilities.protocol_connect_tcp": return false; - case "capabilities.protocol_accept_tcp": return false; - case "capabilities.protocol_connect_ws": return true; - case "capabilities.protocol_accept_ws": return false; - case "capabilities.protocol_connect_wss": return true; - case "capabilities.protocol_accept_wss": return false; - case "table_store.directory": return ""; - case "protected_store.allow_insecure_fallback": return true; - case "protected_store.always_use_insecure_storage": return false; - case "protected_store.insecure_fallback_directory": return ""; - case "network.max_connections": return 16; - case "network.node_id": return "ZLd4uMYdP4qYLtxF6GqrzBb32Z6T3rE2FWMkWup1pdY"; - case "network.node_id_secret": return "s2Gvq6HJOxgQh-3xIgfWSL3I-DWZ2c1RjZLJl2Xmg2E"; - case "network.bootstrap": return []; - case "network.rpc.concurrency": return 2; - case "network.rpc.queue_size": return 128; - case "network.rpc.max_timestamp_behind": return 10000000; - case "network.rpc.max_timestamp_ahead": return 10000000; - case "network.rpc.timeout": return 10000000; - case "network.rpc.max_route_hop_count": return 7; - case "network.dht.resolve_node_timeout": return null; - case "network.dht.resolve_node_count": return 20; - case "network.dht.resolve_node_fanout": return 3; - case "network.dht.max_find_node_count": return 20; - case "network.dht.get_value_timeout": return null; - case "network.dht.get_value_count": return 20; - case "network.dht.get_value_fanout": return 3; - case "network.dht.set_value_timeout": return null; - case "network.dht.set_value_count": return 20; - case "network.dht.set_value_fanout": return 5; - case "network.dht.min_peer_count": return 20; - case "network.dht.min_peer_refresh_time": return 2000000; - case "network.dht.validate_dial_info_receipt_time": return 5000000; - case "network.upnp": return false; - case "network.natpmp": return false; - case "network.enable_local_peer_scope": return false; - case "network.restricted_nat_retries": return 3; - case "network.tls.certificate_path": return ""; - case "network.tls.private_key_path": return ""; - case "network.application.path": return "/app"; - case "network.application.https.enabled": return false; - case "network.application.https.listen_address": return ""; - case "network.application.http.enabled": return false; - case "network.application.http.listen_address": return ""; - case "network.protocol.udp.enabled": return false; - case "network.protocol.udp.socket_pool_size": return 0; - case "network.protocol.udp.listen_address": return ""; - case "network.protocol.udp.public_address": return ""; - case "network.protocol.tcp.connect": return false; - case "network.protocol.tcp.listen": return false; - case "network.protocol.tcp.max_connections": return 32; - case "network.protocol.tcp.listen_address": return ""; - case "network.protocol.tcp.public_address": return ""; - case "network.protocol.ws.connect": return true; - case "network.protocol.ws.listen": return false; - case "network.protocol.ws.max_connections": return 16; - case "network.protocol.ws.listen_address": return ""; - case "network.protocol.ws.path": return "/ws"; - case "network.protocol.ws.public_address": return ""; - case "network.protocol.wss.connect": return true; - case "network.protocol.wss.listen": return false; - case "network.protocol.wss.max_connections": return 16; - case "network.protocol.wss.listen_address": return ""; - case "network.protocol.wss.path": return "/ws"; - case "network.protocol.wss.public_address": return ""; - default: - console.log("config key '" + key +"' doesn't exist"); break; - } - }; - true - "#).expect("failed to eval"), JsValue::TRUE); -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// -/// - -#[wasm_bindgen_test] -fn test_construct() { - setup(); - - assert_eq!( - js_sys::eval( - r#" - let vc = new VeilidCore(); - true - "# - ) - .expect("failed to eval"), - JsValue::TRUE - ); -} - -#[wasm_bindgen_test(async)] -async fn test_startup_shutdown() { - setup(); - - assert_eq!( - JsFuture::from( - js_sys::eval( - r#" - (async function() { - let vc = new VeilidCore(); - await vc.startup(window.stateChangeCallback, window.configCallback); - await vc.shutdown(); - return true; - })().then(v => { - console.log("finished: " + v); - return v; - }); - "# - ) - .expect("failed to eval") - .dyn_into::() - .unwrap() - ) - .await, - Ok(JsValue::TRUE) - ); -} - -#[wasm_bindgen_test(async)] -async fn test_attach_detach() { - setup(); - - assert_eq!( - JsFuture::from( - js_sys::eval( - r#" - (async function() { - let vc = new VeilidCore(); - await vc.startup(window.stateChangeCallback, window.configCallback); - await vc.attach(); - await window.sleep(1000); - await vc.detach(); - await vc.shutdown(); - return true; - })().then(v => { - console.log("finished: " + v); - return v; - }); - "# - ) - .expect("failed to eval") - .dyn_into::() - .unwrap() - ) - .await, - Ok(JsValue::TRUE) - ); -}