global: snapshot

This commit is contained in:
nym21
2025-02-02 23:55:05 +01:00
parent 1e37d75e49
commit 42c996e16e
15 changed files with 55 additions and 28 deletions
Generated
+10 -10
View File
@@ -371,7 +371,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.96",
"syn 2.0.98",
]
[[package]]
@@ -487,9 +487,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
[[package]]
name = "jiff"
version = "0.1.28"
version = "0.1.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c607c728e28764fecde611a2764a3a5db19ae21dcec46f292244f5cc5c085a81"
checksum = "c04ef77ae73f3cf50510712722f0c4e8b46f5aaa1bf5ffad2ae213e6495e78e5"
dependencies = [
"jiff-tzdb-platform",
"log",
@@ -898,14 +898,14 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.96",
"syn 2.0.98",
]
[[package]]
name = "serde_json"
version = "1.0.137"
version = "1.0.138"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b"
checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949"
dependencies = [
"itoa",
"memchr",
@@ -961,7 +961,7 @@ name = "struct_iterable_derive"
version = "0.1.0"
dependencies = [
"quote",
"syn 2.0.96",
"syn 2.0.98",
]
[[package]]
@@ -981,9 +981,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.96"
version = "2.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1"
dependencies = [
"proc-macro2",
"quote",
@@ -1196,5 +1196,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.96",
"syn 2.0.98",
]
+1 -1
View File
@@ -19,7 +19,7 @@ color-eyre = "0.6.3"
derive_deref = "1.1.1"
exit = { path = "exit" }
fjall = "2.5.0"
jiff = "0.1.28"
jiff = "0.1.29"
rayon = "1.10.0"
storable_vec = { path = "storable_vec" }
struct_iterable = { path = "struct_iterable" }
+1 -1
View File
@@ -13,7 +13,7 @@ bitcoin = { workspace = true }
rayon = { workspace = true }
crossbeam = { version = "0.8.4", features = ["crossbeam-channel"] }
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.137"
serde_json = "1.0.138"
derive_deref = { workspace = true }
bitcoincore-rpc = "0.19.0"
# tokio = { version = "1.39.2", features = ["rt-multi-thread"] }
+5
View File
@@ -0,0 +1,5 @@
mod error;
mod value;
pub use error::*;
pub use value::*;
+23 -14
View File
@@ -13,21 +13,28 @@ use std::{
use memmap2::{Mmap, MmapOptions};
use unsafe_slice_serde::UnsafeSliceSerde;
mod any;
// mod bytes;
mod error;
mod index;
mod type_;
mod value;
mod version;
mod enums;
mod structs;
mod traits;
pub use any::*;
// pub use bytes::*;
pub use error::*;
pub use index::*;
pub use type_::*;
pub use value::*;
pub use version::*;
pub use enums::*;
pub use structs::*;
pub use traits::*;
/// Uses `Mmap` instead of `File`
///
/// Used in `/indexer`
const CACHED: u8 = 0;
/// Will use the same `File` for every read, so not thread safe
///
/// Used in `/computer`
const RAW_SYNC: u8 = 1;
/// Will spin up a new `File` for every read
///
/// Used in `/server`
const RAW_ASYNC: u8 = 2;
///
/// A very small, fast, efficient and simple storable Vec
@@ -45,6 +52,7 @@ pub struct StorableVec<I, T> {
pathbuf: PathBuf,
unsafe_file: File,
cache: Vec<OnceLock<Box<Mmap>>>, // Boxed Mmap to reduce the size of the Lock (from 24 to 16)
buf: Vec<u8>,
disk_len: usize,
pushed: Vec<T>,
// updated: BTreeMap<usize, T>,
@@ -89,6 +97,7 @@ where
pathbuf: path.to_owned(),
disk_len: Self::disk_len(&unsafe_file)?,
unsafe_file,
buf: vec![0; Self::SIZE_OF_T],
cache: vec![],
pushed: vec![],
// updated: BTreeMap::new(),
+3
View File
@@ -0,0 +1,3 @@
mod version;
pub use version::*;
@@ -1,6 +1,8 @@
use std::io;
use crate::{StorableVec, StorableVecIndex, StorableVecType};
use crate::StorableVec;
use super::{StorableVecIndex, StorableVecType};
pub trait AnyStorableVec {
fn len(&self) -> usize;
+8
View File
@@ -0,0 +1,8 @@
mod any;
// mod bytes;
mod index;
mod type_;
pub use any::*;
pub use index::*;
pub use type_::*;
@@ -11,5 +11,5 @@ proc-macro = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
syn = "2.0.96"
syn = "2.0.98"
quote = "1.0.38"