diff --git a/Cargo.lock b/Cargo.lock index d1bd530..e03a198 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,9 +51,9 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead", "aes", @@ -484,7 +484,7 @@ dependencies = [ "itertools 0.12.1", "leb128", "serde", - "sha2 0.10.7", + "sha2 0.10.8", "smol_str", "thiserror", "tinyvec", @@ -1355,18 +1355,31 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.2" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d928d978dbec61a1167414f5ec534f24bea0d7a0d24dd9b6233d3d8223e585" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", "fiat-crypto", - "packed_simd_2", "platforms", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + [[package]] name = "darling" version = "0.20.1" @@ -1414,6 +1427,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f215f9b7224f49fb73256115331f677d868b34d18b65dbe4db392e6021eea90" +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + [[package]] name = "derivative" version = "2.2.0" @@ -1528,7 +1551,7 @@ dependencies = [ "rust_decimal", "serde", "thiserror", - "time 0.3.23", + "time 0.3.36", ] [[package]] @@ -1744,9 +1767,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "field-offset" @@ -2881,12 +2904,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "libm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - [[package]] name = "libz-sys" version = "1.1.12" @@ -3240,7 +3257,7 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] name = "nextgraph" -version = "0.1.0-preview.1" +version = "0.1.0-preview.2" dependencies = [ "async-once-cell", "async-std", @@ -3368,7 +3385,7 @@ dependencies = [ [[package]] name = "ng-oxigraph" -version = "0.4.0-alpha.7-ngpreview" +version = "0.4.0-alpha.7-ngpreview2" dependencies = [ "codspeed-criterion-compat", "digest 0.10.7", @@ -3388,8 +3405,8 @@ dependencies = [ "regex", "serde", "sha1", - "sha2 0.10.7", - "siphasher 0.3.10", + "sha2 0.10.8", + "siphasher 1.0.1", "thiserror", "zstd", ] @@ -3421,7 +3438,7 @@ dependencies = [ "serde_json", "slice_as_array", "threshold_crypto", - "time 0.3.23", + "time 0.3.36", "wasm-bindgen", "web-time", "zeroize", @@ -3498,7 +3515,7 @@ dependencies = [ [[package]] name = "ng-verifier" -version = "0.1.0-preview.1" +version = "0.1.0-preview.2" dependencies = [ "async-std", "async-trait", @@ -3642,25 +3659,25 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "noise-protocol" -version = "0.2.0-rc1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eecce5634c8ec4e9352dbb67bedaff4796503d81913cf27763bc121dac32fbd9" +checksum = "2473d39689a839f5a363aaef7d99f76d5611bf352286682b25a6644fec18b1d3" dependencies = [ "arrayvec", ] [[package]] name = "noise-rust-crypto" -version = "0.6.0-rc.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16c166af96e587866c91d5fba009fbab882ebeb892ab3e576b676120262b7f93" +checksum = "b4c6159f60beb3bbbcdc266bc789bfc6c37fdad7d7ca7152d3e049ef5af633f0" dependencies = [ "aes-gcm", "blake2", "chacha20poly1305", "noise-protocol", - "sha2 0.10.7", - "x25519-dalek 2.0.0-rc.2", + "sha2 0.10.8", + "x25519-dalek 2.0.1", "zeroize", ] @@ -3695,6 +3712,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.45" @@ -3929,16 +3952,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "packed_simd_2" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" -dependencies = [ - "cfg-if", - "libm", -] - [[package]] name = "pairing" version = "0.16.0" @@ -4235,7 +4248,7 @@ dependencies = [ "line-wrap", "quick-xml 0.28.2", "serde", - "time 0.3.23", + "time 0.3.36", ] [[package]] @@ -4318,6 +4331,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -4698,7 +4717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512b0ab6853f7e14e3c8754acb43d6f748bb9ced66aa5915a6553ac8213f7731" dependencies = [ "globset", - "sha2 0.10.7", + "sha2 0.10.8", "walkdir", ] @@ -4988,7 +5007,7 @@ dependencies = [ "serde", "serde_json", "serde_with_macros", - "time 0.3.23", + "time 0.3.36", ] [[package]] @@ -5061,9 +5080,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -5517,10 +5536,10 @@ dependencies = [ "semver", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "tauri-utils", "thiserror", - "time 0.3.23", + "time 0.3.36", "url", "uuid", "walkdir", @@ -5746,11 +5765,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.23" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ + "deranged", "itoa 1.0.6", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -5758,16 +5780,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -6876,7 +6899,7 @@ dependencies = [ "once_cell", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "soup3", "tao", "thiserror", @@ -6941,13 +6964,12 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0-rc.2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabd6e16dd08033932fc3265ad4510cc2eab24656058a6dcb107ffe274abcc95" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek 4.0.0-rc.2", + "curve25519-dalek 4.1.2", "rand_core 0.6.4", - "serde", "zeroize", ] diff --git a/nextgraph/Cargo.toml b/nextgraph/Cargo.toml index 6bb9a0f..8c4c6fb 100644 --- a/nextgraph/Cargo.toml +++ b/nextgraph/Cargo.toml @@ -2,7 +2,7 @@ name = "nextgraph" description = "NextGraph client library. Nextgraph is a decentralized, secure and local-first web 3.0 ecosystem based on Semantic Web and CRDTs" categories = ["asynchronous","text-editors","web-programming","development-tools","database-implementations"] -version.workspace = true +version = "0.1.0-preview.2" edition.workspace = true license.workspace = true authors.workspace = true @@ -30,7 +30,7 @@ ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1" } ng-net = { path = "../ng-net", version = "0.1.0-preview.1" } ng-wallet = { path = "../ng-wallet", version = "0.1.0-preview.1" } ng-client-ws = { path = "../ng-client-ws", version = "0.1.0-preview.1" } -ng-verifier = { path = "../ng-verifier", version = "0.1.0-preview.1" } +ng-verifier = { path = "../ng-verifier", version = "0.1.0-preview.2" } [target.'cfg(all(not(target_arch = "wasm32"),not(doc)))'.dependencies] ng-storage-rocksdb = { path = "../ng-storage-rocksdb", version = "0.1.0-preview.1" } @@ -48,4 +48,5 @@ required-features = [] [[example]] name = "open" -required-features = [] \ No newline at end of file +required-features = [] + diff --git a/nextgraph/README.md b/nextgraph/README.md index f96c85d..0761ad5 100644 --- a/nextgraph/README.md +++ b/nextgraph/README.md @@ -1,5 +1,5 @@

- nextgraph-header + nextgraph-header

# nextgraph @@ -51,8 +51,8 @@ async-std = "1.12.0" You can find some examples on how to use the library: -- [in_memory](examples/in_memory) -- [persistent](examples/persistent) +- [in_memory](https://git.nextgraph.org/NextGraph/nextgraph-rs/src/branch/master/nextgraph/examples) +- [persistent](https://git.nextgraph.org/NextGraph/nextgraph-rs/src/branch/master/nextgraph/examples) ## License diff --git a/nextgraph/src/local_broker.rs b/nextgraph/src/local_broker.rs index 3692c8d..9673aba 100644 --- a/nextgraph/src/local_broker.rs +++ b/nextgraph/src/local_broker.rs @@ -46,7 +46,7 @@ use ng_wallet::{create_wallet_first_step_v0, create_wallet_second_step_v0, types use ng_client_ws::remote_ws::ConnectionWebSocket; #[cfg(target_arch = "wasm32")] use ng_client_ws::remote_ws_wasm::ConnectionWebSocket; -#[cfg(all(not(target_family = "wasm"),not(doc)))] +#[cfg(not(any(target_family = "wasm",doc)))] use ng_storage_rocksdb::block_storage::RocksDbBlockStorage; #[doc(hidden)] diff --git a/ng-net/Cargo.toml b/ng-net/Cargo.toml index e18b966..7c5ed6c 100644 --- a/ng-net/Cargo.toml +++ b/ng-net/Cargo.toml @@ -29,8 +29,8 @@ async-trait = "0.1.64" async-recursion = "1.1.1" async-std = { version = "1.12.0", features = ["attributes","unstable"] } unique_id = "0.1.5" -noise-protocol = "0.2.0-rc1" -noise-rust-crypto = "0.6.0-rc.1" +noise-protocol = "0.2.0" +noise-rust-crypto = "0.6.2" ed25519-dalek = "1.0.1" url = "2.4.0" regex = "1.8.4" diff --git a/ng-oxigraph/Cargo.toml b/ng-oxigraph/Cargo.toml index 7caee18..eacd6e8 100644 --- a/ng-oxigraph/Cargo.toml +++ b/ng-oxigraph/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ng-oxigraph" -version = "0.4.0-alpha.7-ngpreview" +version = "0.4.0-alpha.7-ngpreview2" authors = ["Tpt ", "Niko PLP "] license = "MIT OR Apache-2.0" readme = "README.md" @@ -65,7 +65,7 @@ elided_lifetimes_in_paths = "warn" explicit_outlives_requirements = "warn" let_underscore_drop = "warn" macro_use_extern_crate = "warn" -# TODO missing_docs = "warn" +# TODO missidoc_auto_cfgs = "warn" trivial_casts = "warn" trivial_numeric_casts = "warn" unsafe_code = "warn" diff --git a/ng-oxigraph/src/lib.rs b/ng-oxigraph/src/lib.rs index a57d060..80993f5 100644 --- a/ng-oxigraph/src/lib.rs +++ b/ng-oxigraph/src/lib.rs @@ -1,6 +1,5 @@ #![doc(test(attr(deny(warnings))))] #![doc(test(attr(allow(deprecated))))] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![doc(html_favicon_url = "https://raw.githubusercontent.com/oxigraph/oxigraph/main/logo.svg")] #![doc(html_logo_url = "https://raw.githubusercontent.com/oxigraph/oxigraph/main/logo.svg")] diff --git a/ng-oxigraph/src/oxigraph/storage/backend/mod.rs b/ng-oxigraph/src/oxigraph/storage/backend/mod.rs index b2412d1..6df3606 100644 --- a/ng-oxigraph/src/oxigraph/storage/backend/mod.rs +++ b/ng-oxigraph/src/oxigraph/storage/backend/mod.rs @@ -3,10 +3,10 @@ #[cfg(any(target_family = "wasm", doc))] pub use fallback::{ColumnFamily, ColumnFamilyDefinition, Db, Iter, Reader, Transaction}; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] pub use oxi_rocksdb::{ColumnFamily, ColumnFamilyDefinition, Db, Iter, Reader, Transaction}; #[cfg(any(target_family = "wasm", doc))] mod fallback; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] mod oxi_rocksdb; diff --git a/ng-oxigraph/src/oxigraph/storage/binary_encoder.rs b/ng-oxigraph/src/oxigraph/storage/binary_encoder.rs index d1cf1ac..4fb2120 100644 --- a/ng-oxigraph/src/oxigraph/storage/binary_encoder.rs +++ b/ng-oxigraph/src/oxigraph/storage/binary_encoder.rs @@ -5,7 +5,7 @@ use crate::oxsdatatypes::*; use std::io::Read; use std::mem::size_of; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] pub const LATEST_STORAGE_VERSION: u64 = 1; pub const WRITTEN_TERM_MAX_SIZE: usize = size_of::() + 2 * size_of::(); diff --git a/ng-oxigraph/src/oxigraph/storage/mod.rs b/ng-oxigraph/src/oxigraph/storage/mod.rs index a20740e..a928efe 100644 --- a/ng-oxigraph/src/oxigraph/storage/mod.rs +++ b/ng-oxigraph/src/oxigraph/storage/mod.rs @@ -1,9 +1,9 @@ #![allow(clippy::same_name_method)] -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use crate::oxigraph::model::Quad; use crate::oxigraph::model::{GraphNameRef, NamedOrBlankNodeRef, QuadRef, TermRef}; use crate::oxigraph::storage::backend::{Reader, Transaction}; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use crate::oxigraph::storage::binary_encoder::LATEST_STORAGE_VERSION; use crate::oxigraph::storage::binary_encoder::{ decode_term, encode_term, encode_term_pair, encode_term_quad, encode_term_triple, @@ -14,24 +14,24 @@ use crate::oxigraph::storage::binary_encoder::{ pub use crate::oxigraph::storage::error::{ CorruptionError, LoaderError, SerializerError, StorageError, }; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use crate::oxigraph::storage::numeric_encoder::Decoder; use crate::oxigraph::storage::numeric_encoder::{ insert_term, EncodedQuad, EncodedTerm, StrHash, StrLookup, }; use backend::{ColumnFamily, ColumnFamilyDefinition, Db, Iter}; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use std::collections::VecDeque; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use std::collections::{HashMap, HashSet}; use std::error::Error; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use std::mem::{swap, take}; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use std::path::{Path, PathBuf}; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use std::sync::Mutex; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use std::{io, thread}; mod backend; @@ -51,16 +51,16 @@ const DSPO_CF: &str = "dspo"; const DPOS_CF: &str = "dpos"; const DOSP_CF: &str = "dosp"; const GRAPHS_CF: &str = "graphs"; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] const DEFAULT_CF: &str = "default"; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] const DEFAULT_BULK_LOAD_BATCH_SIZE: usize = 1_000_000; /// Low level storage primitives #[derive(Clone)] pub struct Storage { db: Db, - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] default_cf: ColumnFamily, id2str_cf: ColumnFamily, spog_cf: ColumnFamily, @@ -80,7 +80,7 @@ impl Storage { Self::setup(Db::new(Self::column_families())?) } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn open(path: &Path, key: Option<[u8; 32]>) -> Result { Self::setup(Db::open_read_write( Some(path), @@ -89,7 +89,7 @@ impl Storage { )?) } - // #[cfg(all(not(target_family = "wasm")))] + // #[cfg(all(not(target_family = "wasm"), not(doc)))] // pub fn open_secondary(primary_path: &Path) -> Result { // Self::setup(Db::open_secondary( // primary_path, @@ -98,7 +98,7 @@ impl Storage { // )?) // } - // #[cfg(all(not(target_family = "wasm")))] + // #[cfg(all(not(target_family = "wasm"), not(doc)))] // pub fn open_persistent_secondary( // primary_path: &Path, // secondary_path: &Path, @@ -110,7 +110,7 @@ impl Storage { // )?) // } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn open_read_only(path: &Path, key: Option<[u8; 32]>) -> Result { Self::setup(Db::open_read_only(path, Self::column_families(), key)?) } @@ -188,7 +188,7 @@ impl Storage { fn setup(db: Db) -> Result { let this = Self { - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] default_cf: db.column_family(DEFAULT_CF)?, id2str_cf: db.column_family(ID2STR_CF)?, spog_cf: db.column_family(SPOG_CF)?, @@ -203,12 +203,12 @@ impl Storage { graphs_cf: db.column_family(GRAPHS_CF)?, db, }; - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] this.migrate()?; Ok(this) } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] fn migrate(&self) -> Result<(), StorageError> { let mut version = self.ensure_version()?; if version == 0 { @@ -248,7 +248,7 @@ impl Storage { } } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] fn ensure_version(&self) -> Result { Ok( if let Some(version) = self.db.get(&self.default_cf, b"oxversion")? { @@ -262,7 +262,7 @@ impl Storage { ) } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] fn update_version(&self, version: u64) -> Result<(), StorageError> { self.db .insert(&self.default_cf, b"oxversion", &version.to_be_bytes())?; @@ -289,12 +289,12 @@ impl Storage { }) } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn flush(&self) -> Result<(), StorageError> { self.db.flush() } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn compact(&self) -> Result<(), StorageError> { self.db.compact(&self.default_cf)?; self.db.compact(&self.gspo_cf)?; @@ -309,7 +309,7 @@ impl Storage { self.db.compact(&self.id2str_cf) } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn backup(&self, target_directory: &Path) -> Result<(), StorageError> { self.db.backup(target_directory) } @@ -634,7 +634,7 @@ impl StorageReader { } } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn get_str(&self, key: &StrHash) -> Result, StorageError> { Ok(self .storage @@ -645,7 +645,7 @@ impl StorageReader { .map_err(CorruptionError::new)?) } - #[cfg(any(target_family = "wasm"))] + #[cfg(any(target_family = "wasm", doc))] pub fn get_str(&self, key: &StrHash) -> Result, StorageError> { Ok(self .reader @@ -655,21 +655,21 @@ impl StorageReader { .map_err(CorruptionError::new)?) } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn contains_str(&self, key: &StrHash) -> Result { self.storage .db .contains_key(&self.storage.id2str_cf, &key.to_be_bytes()) } - #[cfg(any(target_family = "wasm"))] + #[cfg(any(target_family = "wasm", doc))] pub fn contains_str(&self, key: &StrHash) -> Result { self.reader .contains_key(&self.storage.id2str_cf, &key.to_be_bytes()) } /// Validates that all the storage invariants held in the data - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn validate(&self) -> Result<(), StorageError> { // triples let dspo_size = self.dspo_quads(&[]).count(); @@ -781,7 +781,7 @@ impl StorageReader { } /// Validates that all the storage invariants held in the data - #[cfg(any(target_family = "wasm"))] + #[cfg(any(target_family = "wasm", doc))] #[allow(clippy::unused_self, clippy::unnecessary_wraps)] pub fn validate(&self) -> Result<(), StorageError> { Ok(()) // TODO @@ -1005,7 +1005,7 @@ impl<'a> StorageWriter<'a> { } } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] fn insert_str(&mut self, key: &StrHash, value: &str) -> Result<(), StorageError> { if self .storage @@ -1021,7 +1021,7 @@ impl<'a> StorageWriter<'a> { ) } - #[cfg(any(target_family = "wasm"))] + #[cfg(any(target_family = "wasm", doc))] fn insert_str(&mut self, key: &StrHash, value: &str) -> Result<(), StorageError> { self.transaction.insert( &self.storage.id2str_cf, @@ -1186,7 +1186,7 @@ impl<'a> StorageWriter<'a> { } } -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] #[must_use] pub struct StorageBulkLoader { storage: Storage, @@ -1195,7 +1195,7 @@ pub struct StorageBulkLoader { max_memory_size: Option, } -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] impl StorageBulkLoader { pub fn new(storage: Storage) -> Self { Self { @@ -1326,7 +1326,7 @@ impl StorageBulkLoader { } } -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] struct FileBulkLoader<'a> { storage: &'a Storage, id2str: HashMap>, @@ -1335,7 +1335,7 @@ struct FileBulkLoader<'a> { graphs: HashSet, } -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] impl<'a> FileBulkLoader<'a> { fn new(storage: &'a Storage, batch_size: usize) -> Self { Self { @@ -1541,7 +1541,7 @@ impl<'a> FileBulkLoader<'a> { } } -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] fn map_thread_result(result: thread::Result) -> io::Result { result.map_err(|e| { io::Error::new( diff --git a/ng-oxigraph/src/oxigraph/store.rs b/ng-oxigraph/src/oxigraph/store.rs index 310901e..523428b 100644 --- a/ng-oxigraph/src/oxigraph/store.rs +++ b/ng-oxigraph/src/oxigraph/store.rs @@ -25,7 +25,7 @@ //! }; //! # Result::<_, Box>::Ok(()) //! ``` -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use super::io::RdfParseError; use super::io::{RdfFormat, RdfParser, RdfSerializer}; use super::model::*; @@ -34,7 +34,7 @@ use super::sparql::{ QueryResults, Update, UpdateOptions, }; use super::storage::numeric_encoder::{Decoder, EncodedQuad, EncodedTerm}; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use super::storage::StorageBulkLoader; use super::storage::{ ChainedDecodingQuadIterator, DecodingGraphIterator, Storage, StorageReader, StorageWriter, @@ -42,7 +42,7 @@ use super::storage::{ pub use super::storage::{CorruptionError, LoaderError, SerializerError, StorageError}; use std::error::Error; use std::io::{Read, Write}; -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] use std::path::Path; use std::{fmt, str}; @@ -100,14 +100,14 @@ impl Store { /// Only one read-write [`Store`] can exist at the same time. /// If you want to have extra [`Store`] instance opened on a same data /// use [`Store::open_read_only`]. - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn open(path: impl AsRef) -> Result { Ok(Self { storage: Storage::open(path.as_ref(), None)?, }) } - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn open_with_key(path: impl AsRef, key: [u8; 32]) -> Result { Ok(Self { storage: Storage::open(path.as_ref(), Some(key))?, @@ -124,7 +124,7 @@ impl Store { // /// If you prefer persistent storage use [`Store::open_persistent_secondary`]. // /// // /// If you want to simple read-only [`Store`] use [`Store::open_read_only`]. - // #[cfg(all(not(target_family = "wasm")))] + // #[cfg(all(not(target_family = "wasm"), not(doc)))] // pub fn open_secondary(primary_path: impl AsRef) -> Result { // Ok(Self { // storage: Storage::open_secondary(primary_path.as_ref())?, @@ -139,7 +139,7 @@ impl Store { /// `primary_path` must be the path of the primary instance and `secondary_path` an other directory for the secondary instance cache. /// /// If you want to simple read-only [`Store`] use [`Store::open_read_only`]. - // #[cfg(all(not(target_family = "wasm")))] + // #[cfg(all(not(target_family = "wasm"), not(doc)))] // pub fn open_persistent_secondary( // primary_path: impl AsRef, // secondary_path: impl AsRef, @@ -155,7 +155,7 @@ impl Store { /// Opens a read-only [`Store`] from disk. /// /// Opening as read-only while having an other process writing the database is undefined behavior. - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn open_read_only( path: impl AsRef, key: Option<[u8; 32]>, @@ -939,7 +939,7 @@ impl Store { /// Flushes all buffers and ensures that all writes are saved on disk. /// /// Flushes are automatically done using background threads but might lag a little bit. - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn flush(&self) -> Result<(), StorageError> { self.storage.flush() } @@ -949,7 +949,7 @@ impl Store { /// Useful to call after a batch upload or another similar operation. /// ///
Can take hours on huge databases.
- #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn optimize(&self) -> Result<(), StorageError> { self.storage.compact() } @@ -972,7 +972,7 @@ impl Store { /// This allows cheap regular backups. /// /// If you want to move your data to another RDF storage system, you should have a look at the [`Store::dump_to_write`] function instead. - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn backup(&self, target_directory: impl AsRef) -> Result<(), StorageError> { self.storage.backup(target_directory.as_ref()) } @@ -999,7 +999,7 @@ impl Store { /// assert!(store.contains(QuadRef::new(ex, ex, ex, ex))?); /// # Result::<_, Box>::Ok(()) /// ``` - #[cfg(all(not(target_family = "wasm")))] + #[cfg(all(not(target_family = "wasm"), not(doc)))] pub fn bulk_loader(&self) -> BulkLoader { BulkLoader { storage: StorageBulkLoader::new(self.storage.clone()), @@ -1617,14 +1617,14 @@ impl Iterator for GraphNameIter { /// assert!(store.contains(QuadRef::new(ex, ex, ex, ex))?); /// # Result::<_, Box>::Ok(()) /// ``` -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] #[must_use] pub struct BulkLoader { storage: StorageBulkLoader, on_parse_error: Option Result<(), RdfParseError>>>, } -#[cfg(all(not(target_family = "wasm")))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] impl BulkLoader { /// Sets the maximal number of threads to be used by the bulk loader per operation. /// diff --git a/ng-repo/Cargo.toml b/ng-repo/Cargo.toml index a49bfbd..8331c65 100644 --- a/ng-repo/Cargo.toml +++ b/ng-repo/Cargo.toml @@ -41,7 +41,7 @@ crypto_box = { version = "0.8.2", features = ["seal"] } zeroize = { version = "1.6.0", features = ["zeroize_derive"] } base64-url = "2.0.0" web-time = "0.2.0" -time = { version= "0.3.23", features = ["formatting"] } +time = { version= "0.3.36", features = ["formatting"] } wasm-bindgen = "0.2" os_info = "3" current_platform = "0.2.0" diff --git a/ng-verifier/Cargo.toml b/ng-verifier/Cargo.toml index 88de00c..8ca0ed9 100644 --- a/ng-verifier/Cargo.toml +++ b/ng-verifier/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ng-verifier" -version = "0.1.0-preview.1" +version = "0.1.0-preview.2" description = "Verifier library of NextGraph" edition.workspace = true license.workspace = true @@ -32,10 +32,10 @@ yrs = "0.18.2" bloomfilter = { version = "1.0.13", features = ["random","serde"] } ng-repo = { path = "../ng-repo", version = "0.1.0-preview.1" } ng-net = { path = "../ng-net", version = "0.1.0-preview.1" } -ng-oxigraph = { path = "../ng-oxigraph", version = "0.4.0-alpha.7-ngpreview" } +ng-oxigraph = { path = "../ng-oxigraph", version = "0.4.0-alpha.7-ngpreview2" } [target.'cfg(target_arch = "wasm32")'.dependencies] -ng-oxigraph = { path = "../ng-oxigraph", version = "0.4.0-alpha.7-ngpreview", features = ["js"] } +ng-oxigraph = { path = "../ng-oxigraph", version = "0.4.0-alpha.7-ngpreview2", features = ["js"] } [target.'cfg(all(not(target_arch = "wasm32"),not(doc)))'.dependencies] ng-storage-rocksdb = { path = "../ng-storage-rocksdb", version = "0.1.0-preview.1" } diff --git a/ng-verifier/src/lib.rs b/ng-verifier/src/lib.rs index b712eea..d28b395 100644 --- a/ng-verifier/src/lib.rs +++ b/ng-verifier/src/lib.rs @@ -1,3 +1,4 @@ + pub mod types; pub mod site; @@ -11,5 +12,5 @@ mod commits; mod request_processor; -#[cfg(not(target_family = "wasm"))] +#[cfg(all(not(target_family = "wasm"), not(doc)))] mod rocksdb_user_storage; diff --git a/ng-wallet/Cargo.toml b/ng-wallet/Cargo.toml index cf6d758..3c5f5fd 100644 --- a/ng-wallet/Cargo.toml +++ b/ng-wallet/Cargo.toml @@ -2,7 +2,7 @@ name = "ng-wallet" version = "0.1.0-preview.1" description = "Wallet library of NextGraph. keeps the secret keys of all identities of the user in a safe wallet. NextGraph is a decentralized, secure and local-first web 3.0 ecosystem based on Semantic Web and CRDTs" -categories = ["authentication "] +categories = ["authentication"] edition.workspace = true license.workspace = true authors.workspace = true