mirror of
https://github.com/allankoechke/cpp-to-rust-systems-samples.git
synced 2026-11-30 10:18:33 +00:00
Initial commit
This commit is contained in:
17
README.md
Normal file
17
README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Companion code for "Rust and Systems Programming: The Complete Guide"
|
||||
|
||||
Everything here was compiled and run while writing the guide (Rust 1.75, g++ 13).
|
||||
|
||||
| Folder | Stage | How to run |
|
||||
| --- | --- | --- |
|
||||
| cpp-cache-lab | 1 | `g++ -O2 -std=c++20 cache_lab.cpp -o cache_lab && ./cache_lab` |
|
||||
| std-samples | 2, 3, 4, 5, 6, 7, 9, 11, 12 | `cargo test` for the library modules; `cargo run --release --example NAME` for count_allocs, executor, http_server, size_class_alloc, layout_bench, crash_test |
|
||||
| arena-tree | 2 | `rustc -O tree.rs && ./tree` |
|
||||
| ffi-sample | 8 | `gcc -c counter.c && ar rcs libcounter.a counter.o && rustc main.rs -L . -l static=counter && ./main` |
|
||||
| crate-samples | 5, 6, 8, 10, 11, 12 | needs crates.io: `cargo run --release --example NAME` for backpressure, parallel, shutdown, proxy; `cargo run` runs src/main.rs |
|
||||
|
||||
Notes:
|
||||
- std-samples uses only the standard library. The pager is Unix-only and the AVX2 code is x86-64 only.
|
||||
- crate-samples/Cargo.lock pins versions that build on Rust 1.75. On a newer toolchain, delete it and let Cargo resolve fresh versions.
|
||||
- The sandbox used for verification had one CPU core, so the parallel and false-sharing examples were checked for correctness only. Measure speedups on your own multi-core machine.
|
||||
- Starter code, not production code.
|
||||
49
arena-tree/tree.rs
Normal file
49
arena-tree/tree.rs
Normal file
@@ -0,0 +1,49 @@
|
||||
use std::{cell::RefCell, rc::{Rc, Weak}};
|
||||
|
||||
// Version 1: arena + indices. No Rc, no RefCell, no lifetimes to fight.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct NodeId(usize);
|
||||
|
||||
struct Node<T> { value: T, parent: Option<NodeId>, children: Vec<NodeId> }
|
||||
|
||||
pub struct Tree<T> { nodes: Vec<Node<T>> }
|
||||
|
||||
impl<T> Tree<T> {
|
||||
pub fn new(root: T) -> Self {
|
||||
Tree { nodes: vec![Node { value: root, parent: None, children: vec![] }] }
|
||||
}
|
||||
pub fn root(&self) -> NodeId { NodeId(0) }
|
||||
pub fn add_child(&mut self, parent: NodeId, value: T) -> NodeId {
|
||||
let id = NodeId(self.nodes.len());
|
||||
self.nodes.push(Node { value, parent: Some(parent), children: vec![] });
|
||||
self.nodes[parent.0].children.push(id);
|
||||
id
|
||||
}
|
||||
pub fn value(&self, id: NodeId) -> &T { &self.nodes[id.0].value }
|
||||
pub fn parent(&self, id: NodeId) -> Option<NodeId> { self.nodes[id.0].parent }
|
||||
pub fn depth(&self, mut id: NodeId) -> usize {
|
||||
let mut d = 0;
|
||||
while let Some(p) = self.parent(id) { id = p; d += 1; }
|
||||
d
|
||||
}
|
||||
}
|
||||
|
||||
// Version 2: the Rc/Weak/RefCell shape from the Book. Compare how much ceremony it needs.
|
||||
pub struct RcNode {
|
||||
pub value: i32,
|
||||
pub parent: RefCell<Weak<RcNode>>, // Weak so parent <-> child is not a reference cycle
|
||||
pub children: RefCell<Vec<Rc<RcNode>>>,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut t = Tree::new("root");
|
||||
let a = t.add_child(t.root(), "a");
|
||||
let b = t.add_child(a, "b");
|
||||
println!("{} depth {}", t.value(b), t.depth(b));
|
||||
|
||||
let leaf = Rc::new(RcNode { value: 3, parent: RefCell::new(Weak::new()), children: RefCell::new(vec![]) });
|
||||
let branch = Rc::new(RcNode { value: 5, parent: RefCell::new(Weak::new()), children: RefCell::new(vec![Rc::clone(&leaf)]) });
|
||||
*leaf.parent.borrow_mut() = Rc::downgrade(&branch);
|
||||
println!("leaf parent = {:?}", leaf.parent.borrow().upgrade().map(|p| p.value));
|
||||
println!("strong={} weak={}", Rc::strong_count(&branch), Rc::weak_count(&branch));
|
||||
}
|
||||
20
cpp-cache-lab/cache_lab.cpp
Normal file
20
cpp-cache-lab/cache_lab.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
// g++ -O2 -std=c++20 cache_lab.cpp -o cache_lab && ./cache_lab
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
|
||||
int main() {
|
||||
const size_t N = size_t(1) << 26; // 64M ints = 256 MiB, far bigger than any cache
|
||||
const size_t touches = size_t(1) << 22; // same amount of work for every stride
|
||||
std::vector<int32_t> a(N, 1);
|
||||
int64_t sink = 0;
|
||||
for (size_t stride : {1, 2, 4, 8, 16, 32, 64, 256, 1024, 4096}) {
|
||||
auto t0 = std::chrono::steady_clock::now();
|
||||
for (size_t k = 0; k < touches; ++k) sink += a[(k * stride) & (N - 1)];
|
||||
auto t1 = std::chrono::steady_clock::now();
|
||||
double ns = std::chrono::duration<double, std::nano>(t1 - t0).count() / touches;
|
||||
std::printf("stride %5zu %6.2f ns/element\n", stride, ns);
|
||||
}
|
||||
std::printf("(ignore) %lld\n", (long long)sink); // keeps the loop from being optimised away
|
||||
}
|
||||
638
crate-samples/Cargo.lock
generated
Normal file
638
crate-samples/Cargo.lock
generated
Normal file
@@ -0,0 +1,638 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "addr2line"
|
||||
version = "0.27.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e567177890eb1617b1f774005b66b26b2377afd138a2ca37aae7d8f0c81429d4"
|
||||
dependencies = [
|
||||
"gimli",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "adler2"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
|
||||
|
||||
[[package]]
|
||||
name = "ahash"
|
||||
version = "0.8.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"once_cell",
|
||||
"version_check",
|
||||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "allocator-api2"
|
||||
version = "0.2.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.77"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42f4220217f3288537b83684130f42fad43320b1c3b805f1910d683d52ded24f"
|
||||
dependencies = [
|
||||
"addr2line",
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"miniz_oxide",
|
||||
"object",
|
||||
"rustc-demangle",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "2.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
|
||||
|
||||
[[package]]
|
||||
name = "bytes"
|
||||
version = "1.12.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "776dfebd015e2d8732c684a2c71003674ccb49457b539b9e82151ba38e96dd7c"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-deque"
|
||||
version = "0.8.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
|
||||
dependencies = [
|
||||
"crossbeam-epoch",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.9.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
|
||||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e35d6e78f4cebb90e51d543db8fe41528851d6deeef6ef21ebd4bfdc1e784776"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ext"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"memmap2",
|
||||
"rayon",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-core"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
|
||||
|
||||
[[package]]
|
||||
name = "futures-macro"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.10",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-sink"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
|
||||
|
||||
[[package]]
|
||||
name = "futures-task"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
|
||||
|
||||
[[package]]
|
||||
name = "futures-util"
|
||||
version = "0.3.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-macro",
|
||||
"futures-task",
|
||||
"pin-project-lite",
|
||||
"slab",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gimli"
|
||||
version = "0.34.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1033caf0b349c518623b5396bfb2cf0bddf44f0306d543a250e5743297aafd10"
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.14.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"allocator-api2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.191"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
version = "0.4.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
|
||||
dependencies = [
|
||||
"scopeguard",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
||||
|
||||
[[package]]
|
||||
name = "memmap2"
|
||||
version = "0.9.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c"
|
||||
dependencies = [
|
||||
"adler2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mio"
|
||||
version = "0.8.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"wasi",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num_cpus"
|
||||
version = "1.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b"
|
||||
dependencies = [
|
||||
"hermit-abi",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "object"
|
||||
version = "0.40.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd229a0361b9d0d4396176e02d65897f487eebeab7caa6d443855ee152ca0b9c"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.21.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.12.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
"parking_lot_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot_core"
|
||||
version = "0.9.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"smallvec",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.107"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.47"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rayon"
|
||||
version = "1.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051"
|
||||
dependencies = [
|
||||
"either",
|
||||
"rayon-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rayon-core"
|
||||
version = "1.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
|
||||
dependencies = [
|
||||
"crossbeam-deque",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.5.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb"
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "signal-hook-registry"
|
||||
version = "1.4.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
|
||||
dependencies = [
|
||||
"errno",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "slab"
|
||||
version = "0.4.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.16.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59"
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.5.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.119"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "3.0.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.38.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes",
|
||||
"libc",
|
||||
"mio",
|
||||
"num_cpus",
|
||||
"parking_lot",
|
||||
"pin-project-lite",
|
||||
"signal-hook-registry",
|
||||
"socket2",
|
||||
"tokio-macros",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-macros"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.119",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-util"
|
||||
version = "0.7.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
"futures-util",
|
||||
"hashbrown",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.11.1+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
|
||||
|
||||
[[package]]
|
||||
name = "windows-link"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.48.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
|
||||
dependencies = [
|
||||
"windows-targets 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
||||
dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.61.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.48.5",
|
||||
"windows_aarch64_msvc 0.48.5",
|
||||
"windows_i686_gnu 0.48.5",
|
||||
"windows_i686_msvc 0.48.5",
|
||||
"windows_x86_64_gnu 0.48.5",
|
||||
"windows_x86_64_gnullvm 0.48.5",
|
||||
"windows_x86_64_msvc 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.52.6",
|
||||
"windows_aarch64_msvc 0.52.6",
|
||||
"windows_i686_gnu 0.52.6",
|
||||
"windows_i686_gnullvm",
|
||||
"windows_i686_msvc 0.52.6",
|
||||
"windows_x86_64_gnu 0.52.6",
|
||||
"windows_x86_64_gnullvm 0.52.6",
|
||||
"windows_x86_64_msvc 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.8.64"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed43f3060383c64b000f3c630550aebdfa9d3b76d48de32390483dd2cc7e0865"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.8.64"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a5cbd820fe3e35fb38c83b6dc7e6b1618bc46e0cd10073ae94e8d52dc468d8b9"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.119",
|
||||
]
|
||||
9
crate-samples/Cargo.toml
Normal file
9
crate-samples/Cargo.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "ext"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
[dependencies]
|
||||
rayon = "=1.8.1"
|
||||
memmap2 = "=0.9.4"
|
||||
tokio = { version = "=1.38.0", features = ["full"] }
|
||||
tokio-util = { version = "=0.7.11", features = ["rt"] }
|
||||
27
crate-samples/examples/backpressure.rs
Normal file
27
crate-samples/examples/backpressure.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
use std::time::Instant;
|
||||
use tokio::{sync::mpsc, time::{sleep, Duration}};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let (tx, mut rx) = mpsc::channel::<u64>(8); // bounded: send().await waits while the queue is full
|
||||
let start = Instant::now();
|
||||
let producer = tokio::spawn(async move {
|
||||
for i in 0..50u64 {
|
||||
tx.send(i).await.unwrap(); // pushes back on the producer instead of buffering without limit
|
||||
if i % 10 == 0 {
|
||||
println!("sent {i} at {:?}", start.elapsed());
|
||||
}
|
||||
}
|
||||
});
|
||||
let consumer = tokio::spawn(async move {
|
||||
while let Some(i) = rx.recv().await {
|
||||
sleep(Duration::from_millis(5)).await; // slow consumer
|
||||
if i % 10 == 0 {
|
||||
println!("consumed {i} at {:?}", start.elapsed());
|
||||
}
|
||||
}
|
||||
});
|
||||
producer.await.unwrap();
|
||||
consumer.await.unwrap();
|
||||
println!("total {:?}", start.elapsed());
|
||||
}
|
||||
83
crate-samples/examples/parallel.rs
Normal file
83
crate-samples/examples/parallel.rs
Normal file
@@ -0,0 +1,83 @@
|
||||
use rayon::prelude::*;
|
||||
use std::sync::atomic::{AtomicU64, Ordering::Relaxed};
|
||||
use std::time::Instant;
|
||||
|
||||
pub fn prefix_sum(xs: &mut [u64]) {
|
||||
let chunk = (xs.len() / rayon::current_num_threads()).max(1024);
|
||||
// Pass 1: local prefix sums inside each chunk; collect each chunk's total.
|
||||
let totals: Vec<u64> = xs
|
||||
.par_chunks_mut(chunk)
|
||||
.map(|c| {
|
||||
let mut acc = 0;
|
||||
for x in c.iter_mut() { acc += *x; *x = acc; }
|
||||
acc
|
||||
})
|
||||
.collect();
|
||||
// Pass 2: exclusive scan of the (few) totals, sequentially.
|
||||
let mut offsets = Vec::with_capacity(totals.len());
|
||||
let mut run = 0;
|
||||
for t in &totals { offsets.push(run); run += t; }
|
||||
// Pass 3: add each chunk's offset.
|
||||
xs.par_chunks_mut(chunk).zip(offsets.par_iter()).for_each(|(c, &off)| {
|
||||
for x in c.iter_mut() { *x += off; }
|
||||
});
|
||||
}
|
||||
|
||||
pub fn blur(src: &[f32], w: usize, h: usize) -> Vec<f32> {
|
||||
let mut dst = vec![0f32; w * h];
|
||||
dst.par_chunks_mut(w).enumerate().for_each(|(y, row)| {
|
||||
for (x, out) in row.iter_mut().enumerate() {
|
||||
let (mut sum, mut n) = (0f32, 0f32);
|
||||
for dy in -2i64..=2 {
|
||||
for dx in -2i64..=2 {
|
||||
let (yy, xx) = (y as i64 + dy, x as i64 + dx);
|
||||
if yy >= 0 && yy < h as i64 && xx >= 0 && xx < w as i64 {
|
||||
sum += src[yy as usize * w + xx as usize];
|
||||
n += 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
*out = sum / n;
|
||||
}
|
||||
});
|
||||
dst
|
||||
}
|
||||
|
||||
#[repr(align(64))]
|
||||
struct Padded(AtomicU64);
|
||||
|
||||
fn hammer<T: Sync>(slots: &[T], get: impl Fn(&T) -> &AtomicU64 + Sync) -> f64 {
|
||||
let t = Instant::now();
|
||||
std::thread::scope(|s| {
|
||||
for slot in slots {
|
||||
let get = &get;
|
||||
s.spawn(move || { for _ in 0..20_000_000 { get(slot).fetch_add(1, Relaxed); } });
|
||||
}
|
||||
});
|
||||
t.elapsed().as_secs_f64() * 1e3
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// prefix sum correctness
|
||||
let mut v: Vec<u64> = (1..=100_000).collect();
|
||||
let want: Vec<u64> = v.iter().scan(0, |a, &x| { *a += x; Some(*a) }).collect();
|
||||
prefix_sum(&mut v);
|
||||
assert_eq!(v, want);
|
||||
println!("prefix_sum ok");
|
||||
|
||||
// speedup vs threads
|
||||
let (w, h) = (2048, 2048);
|
||||
let img: Vec<f32> = (0..w * h).map(|i| (i % 251) as f32).collect();
|
||||
for threads in [1, 2, 4] {
|
||||
let pool = rayon::ThreadPoolBuilder::new().num_threads(threads).build().unwrap();
|
||||
let t = Instant::now();
|
||||
let out = pool.install(|| blur(&img, w, h));
|
||||
println!("blur {threads} thread(s): {:>7.1} ms (checksum {:.1})", t.elapsed().as_secs_f64() * 1e3, out[w * 5 + 5]);
|
||||
}
|
||||
|
||||
// false sharing
|
||||
let adjacent: Vec<AtomicU64> = (0..4).map(|_| AtomicU64::new(0)).collect();
|
||||
let padded: Vec<Padded> = (0..4).map(|_| Padded(AtomicU64::new(0))).collect();
|
||||
println!("adjacent counters: {:>7.1} ms", hammer(&adjacent, |a| a));
|
||||
println!("padded counters: {:>7.1} ms", hammer(&padded, |p| &p.0));
|
||||
}
|
||||
58
crate-samples/examples/proxy.rs
Normal file
58
crate-samples/examples/proxy.rs
Normal file
@@ -0,0 +1,58 @@
|
||||
use std::sync::atomic::{AtomicUsize, Ordering::Relaxed};
|
||||
use tokio::{io::{copy_bidirectional, AsyncReadExt, AsyncWriteExt}, net::{TcpListener, TcpStream}};
|
||||
|
||||
static NEXT: AtomicUsize = AtomicUsize::new(0);
|
||||
|
||||
/// Round-robin over the backends. A real proxy would skip unhealthy ones.
|
||||
fn pick(backends: &[String]) -> &str {
|
||||
&backends[NEXT.fetch_add(1, Relaxed) % backends.len()]
|
||||
}
|
||||
|
||||
async fn run_proxy(listener: TcpListener, backends: Vec<String>) -> std::io::Result<()> {
|
||||
loop {
|
||||
let (mut inbound, _) = listener.accept().await?;
|
||||
let target = pick(&backends).to_string();
|
||||
tokio::spawn(async move {
|
||||
match TcpStream::connect(&target).await {
|
||||
Ok(mut outbound) => {
|
||||
// Shuttles bytes both ways until either side closes.
|
||||
let _ = copy_bidirectional(&mut inbound, &mut outbound).await;
|
||||
}
|
||||
Err(e) => eprintln!("backend {target} unreachable: {e}"),
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// --- test scaffolding: two echo backends that tag their replies ---
|
||||
async fn tagged_backend(tag: &'static str) -> String {
|
||||
let l = TcpListener::bind("127.0.0.1:0").await.unwrap();
|
||||
let addr = l.local_addr().unwrap().to_string();
|
||||
tokio::spawn(async move {
|
||||
loop {
|
||||
let (mut s, _) = l.accept().await.unwrap();
|
||||
tokio::spawn(async move {
|
||||
let mut b = [0u8; 64];
|
||||
let n = s.read(&mut b).await.unwrap();
|
||||
s.write_all(format!("{tag}:{}", String::from_utf8_lossy(&b[..n])).as_bytes()).await.unwrap();
|
||||
});
|
||||
}
|
||||
});
|
||||
addr
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
let backends = vec![tagged_backend("A").await, tagged_backend("B").await];
|
||||
let listener = TcpListener::bind("127.0.0.1:0").await?;
|
||||
let proxy_addr = listener.local_addr()?;
|
||||
tokio::spawn(run_proxy(listener, backends));
|
||||
for _ in 0..4 {
|
||||
let mut c = TcpStream::connect(proxy_addr).await?;
|
||||
c.write_all(b"hi").await?;
|
||||
let mut reply = String::new();
|
||||
c.read_to_string(&mut reply).await?;
|
||||
println!("{reply}");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
38
crate-samples/examples/shutdown.rs
Normal file
38
crate-samples/examples/shutdown.rs
Normal file
@@ -0,0 +1,38 @@
|
||||
use tokio::{io::{AsyncReadExt, AsyncWriteExt}, net::TcpListener};
|
||||
use tokio_util::task::TaskTracker;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
let listener = TcpListener::bind("127.0.0.1:0").await?;
|
||||
let tracker = TaskTracker::new();
|
||||
let (stop_tx, mut stop_rx) = tokio::sync::watch::channel(false);
|
||||
|
||||
let conns = tracker.clone();
|
||||
let server = tokio::spawn(async move {
|
||||
loop {
|
||||
tokio::select! {
|
||||
res = listener.accept() => {
|
||||
let (mut sock, _) = res.unwrap();
|
||||
conns.spawn(async move { // tracked: shutdown will wait for it
|
||||
let mut buf = [0u8; 4096];
|
||||
loop {
|
||||
match sock.read(&mut buf).await {
|
||||
Ok(0) | Err(_) => return,
|
||||
Ok(n) => { if sock.write_all(&buf[..n]).await.is_err() { return; } }
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
_ = stop_rx.changed() => break, // stop accepting new connections
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// ... run until a signal arrives, then:
|
||||
stop_tx.send(true).unwrap();
|
||||
server.await.unwrap();
|
||||
tracker.close();
|
||||
tracker.wait().await; // in-flight work finishes (add a deadline)
|
||||
println!("clean shutdown");
|
||||
Ok(())
|
||||
}
|
||||
79
crate-samples/src/main.rs
Normal file
79
crate-samples/src/main.rs
Normal file
@@ -0,0 +1,79 @@
|
||||
use rayon::prelude::*;
|
||||
use std::sync::atomic::{AtomicU64, Ordering::Relaxed};
|
||||
use tokio::{io::{AsyncReadExt, AsyncWriteExt}, net::TcpListener};
|
||||
use tokio_util::task::TaskTracker;
|
||||
|
||||
pub fn blur(src: &[f32], w: usize, h: usize) -> Vec<f32> {
|
||||
let mut dst = vec![0f32; w * h];
|
||||
dst.par_chunks_mut(w).enumerate().for_each(|(y, row)| {
|
||||
for (x, out) in row.iter_mut().enumerate() {
|
||||
let (mut sum, mut n) = (0f32, 0f32);
|
||||
for dy in -1i64..=1 {
|
||||
for dx in -1i64..=1 {
|
||||
let (yy, xx) = (y as i64 + dy, x as i64 + dx);
|
||||
if yy >= 0 && yy < h as i64 && xx >= 0 && xx < w as i64 {
|
||||
sum += src[yy as usize * w + xx as usize];
|
||||
n += 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
*out = sum / n;
|
||||
}
|
||||
});
|
||||
dst
|
||||
}
|
||||
|
||||
#[repr(align(64))]
|
||||
struct Padded(AtomicU64);
|
||||
|
||||
static REQUESTS: AtomicU64 = AtomicU64::new(0);
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
let img = vec![1f32; 64 * 64];
|
||||
let out = blur(&img, 64, 64);
|
||||
println!("blur ok {}", out[100]);
|
||||
let pool = rayon::ThreadPoolBuilder::new().num_threads(2).build().unwrap();
|
||||
let s: u64 = pool.install(|| (0..1000u64).into_par_iter().sum());
|
||||
let _p = Padded(AtomicU64::new(s));
|
||||
let f = std::fs::File::open("/etc/hostname")?;
|
||||
let map = unsafe { memmap2::Mmap::map(&f)? };
|
||||
println!("mmap bytes {}", map.len());
|
||||
|
||||
let listener = TcpListener::bind("127.0.0.1:0").await?;
|
||||
let tracker = TaskTracker::new();
|
||||
let (stop_tx, mut stop_rx) = tokio::sync::watch::channel(false);
|
||||
let addr = listener.local_addr()?;
|
||||
let t2 = tracker.clone();
|
||||
let server = tokio::spawn(async move {
|
||||
loop {
|
||||
tokio::select! {
|
||||
res = listener.accept() => {
|
||||
let (mut sock, _) = res.unwrap();
|
||||
t2.spawn(async move {
|
||||
let mut buf = [0u8; 4096];
|
||||
loop {
|
||||
match sock.read(&mut buf).await {
|
||||
Ok(0) | Err(_) => return,
|
||||
Ok(n) => { REQUESTS.fetch_add(1, Relaxed); if sock.write_all(&buf[..n]).await.is_err() { return; } }
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
_ = stop_rx.changed() => break,
|
||||
}
|
||||
}
|
||||
});
|
||||
let mut c = tokio::net::TcpStream::connect(addr).await?;
|
||||
c.write_all(b"ping").await?;
|
||||
let mut b = [0u8; 4];
|
||||
c.read_exact(&mut b).await?;
|
||||
println!("echo {:?}", std::str::from_utf8(&b));
|
||||
drop(c);
|
||||
stop_tx.send(true).unwrap();
|
||||
server.await.unwrap();
|
||||
tracker.close();
|
||||
tracker.wait().await;
|
||||
println!("drained, requests={}", REQUESTS.load(Relaxed));
|
||||
Ok(())
|
||||
}
|
||||
1
crate-samples/target/.rustc_info.json
Normal file
1
crate-samples/target/.rustc_info.json
Normal file
@@ -0,0 +1 @@
|
||||
{"rustc_fingerprint":17572303121516054641,"outputs":{"5209341346701103639":{"success":true,"status":"","code":0,"stdout":"rustc 1.99.0 (b940084d7 2026-09-28)\nbinary: rustc\ncommit-hash: b940084d7eb6a299eb4bfeb8e34901bc051e7ac4\ncommit-date: 2026-09-28\nhost: x86_64-unknown-linux-gnu\nrelease: 1.99.0\nLLVM version: 23.1.1\n","stderr":""},"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/codeart/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_primitive_alignment=\"16\"\ntarget_has_atomic_primitive_alignment=\"32\"\ntarget_has_atomic_primitive_alignment=\"64\"\ntarget_has_atomic_primitive_alignment=\"8\"\ntarget_has_atomic_primitive_alignment=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}}
|
||||
3
crate-samples/target/CACHEDIR.TAG
Normal file
3
crate-samples/target/CACHEDIR.TAG
Normal file
@@ -0,0 +1,3 @@
|
||||
Signature: 8a477f597d28d172789f06886806bc55
|
||||
# This file is a cache directory tag created by cargo.
|
||||
# For information about cache directory tags see https://bford.info/cachedir/
|
||||
0
crate-samples/target/debug/.cargo-build-lock
Normal file
0
crate-samples/target/debug/.cargo-build-lock
Normal file
0
crate-samples/target/debug/.cargo-lock
Normal file
0
crate-samples/target/debug/.cargo-lock
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
fb52dd6bdc71d70b
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"extra-platforms\", \"serde\", \"std\"]","target":11402411492164584411,"profile":13135368431819533845,"path":17023504034140123860,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/bytes-c180654362670e7e/dep-lib-bytes","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
53fb85b6e06c7d7c
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[]","declared_features":"[\"core\", \"rustc-dep-of-std\"]","target":13840298032947503755,"profile":8979240926782815398,"path":448156597162736468,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/cfg-if-dbae1560be7738fc/dep-lib-cfg_if","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
@@ -0,0 +1 @@
|
||||
5f94ac7173ccbe60
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[15481973119957668846,"build_script_build",false,18319642597787393669]],"local":[{"RerunIfChanged":{"output":"debug/build/crossbeam-deque-0605e3ef11934c7c/output","paths":["build.rs"]}}],"rustflags":[],"config":0,"compile_kind":0}
|
||||
@@ -0,0 +1 @@
|
||||
855e3b8de1713cfe
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"std\"]","target":5408242616063297496,"profile":8225031023867517122,"path":3555938819359263038,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/crossbeam-deque-7ff0cdf96f976572/dep-build-script-build-script-build","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
0b800020f4aa2739
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"std\"]","target":15353977948366730291,"profile":10078248628036736352,"path":12991134951308866860,"deps":[[2543204310390312751,"crossbeam_epoch",false,8122644205265649188],[11050506297539643678,"crossbeam_utils",false,7390612912739160205],[15481973119957668846,"build_script_build",false,6971234069416547423]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/crossbeam-deque-fd0f888094fba7b4/dep-lib-crossbeam_deque","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
247ebe7bde6db970
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[\"alloc\", \"std\"]","declared_features":"[\"alloc\", \"default\", \"loom\", \"loom-crate\", \"nightly\", \"std\"]","target":16242420667881341737,"profile":10078248628036736352,"path":418486770224358978,"deps":[[2543204310390312751,"build_script_build",false,16371716796067083433],[11050506297539643678,"crossbeam_utils",false,7390612912739160205]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/crossbeam-epoch-26a76b851a006cb8/dep-lib-crossbeam_epoch","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
@@ -0,0 +1 @@
|
||||
a9f4df58af0534e3
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[2543204310390312751,"build_script_build",false,5049890515919804015]],"local":[{"RerunIfChanged":{"output":"debug/build/crossbeam-epoch-604a3af992a76480/output","paths":["build.rs"]}}],"rustflags":[],"config":0,"compile_kind":0}
|
||||
@@ -0,0 +1 @@
|
||||
6f960334abd01446
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[\"alloc\", \"std\"]","declared_features":"[\"alloc\", \"default\", \"loom\", \"loom-crate\", \"nightly\", \"std\"]","target":5408242616063297496,"profile":8225031023867517122,"path":18003805643042168508,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/crossbeam-epoch-6702729c88332124/dep-build-script-build-script-build","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
8d903b7849bb9066
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"loom\", \"nightly\", \"std\"]","target":9626079250877207070,"profile":10078248628036736352,"path":3780197774203467401,"deps":[[11050506297539643678,"build_script_build",false,4091723117343592459]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/crossbeam-utils-5c2d90678ad5f91c/dep-lib-crossbeam_utils","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
@@ -0,0 +1 @@
|
||||
3d107c9dcc6d7261
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"loom\", \"nightly\", \"std\"]","target":5408242616063297496,"profile":8225031023867517122,"path":8388839316037012503,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/crossbeam-utils-69c3c9560da5dcb7/dep-build-script-build-script-build","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
0bd084107fb8c838
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"","declared_features":"","target":0,"profile":0,"path":0,"deps":[[11050506297539643678,"build_script_build",false,7021795494606934077]],"local":[{"RerunIfChanged":{"output":"debug/build/crossbeam-utils-a2344d71b4e66b82/output","paths":["no_atomic.rs"]}}],"rustflags":[],"config":0,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
4ea6e350ec859949
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[]","declared_features":"[\"default\", \"serde\", \"std\", \"use_std\"]","target":17124342308084364240,"profile":8979240926782815398,"path":16162886382774349325,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/either-bb40db92cc3131e8/dep-lib-either","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
7f2b601b0cb697df
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[\"default\", \"std\"]","declared_features":"[\"default\", \"std\"]","target":17743456753391690785,"profile":5883798554218409030,"path":9399296719609363843,"deps":[[18070707816531966863,"libc",false,17328119034823138669]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/errno-2089518cc375a17a/dep-lib-errno","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
7401b758bb86944d
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[]","declared_features":"[]","target":15203649252023292424,"profile":18001156104845078607,"path":1193365115188185927,"deps":[[8858041990736880586,"tokio",false,16773703921932670032],[10580169155545709066,"rayon",false,8722109723079235690],[15509557711559852043,"memmap2",false,11400790456180503340],[15966749864389115859,"tokio_util",false,8090137259296688703]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/ext-02df186214bd4a3b/dep-example-parallel","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
6cd04e17eb7a7765
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[]","declared_features":"[]","target":15116418776263970811,"profile":18001156104845078607,"path":1429903190065485163,"deps":[[8858041990736880586,"tokio",false,16773703921932670032],[10580169155545709066,"rayon",false,8722109723079235690],[15509557711559852043,"memmap2",false,11400790456180503340],[15966749864389115859,"tokio_util",false,8090137259296688703]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/ext-1411ac968ddbe6c7/dep-example-backpressure","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
addd45b1e3252ccf
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[]","declared_features":"[]","target":14040559716700841750,"profile":18001156104845078607,"path":10428893127186321588,"deps":[[8858041990736880586,"tokio",false,16773703921932670032],[10580169155545709066,"rayon",false,8722109723079235690],[15509557711559852043,"memmap2",false,11400790456180503340],[15966749864389115859,"tokio_util",false,8090137259296688703]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/ext-14f743292b000c42/dep-example-shutdown","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
6ad5cf09f87d2f2a
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[]","declared_features":"[]","target":1652577313445158598,"profile":18001156104845078607,"path":4942398508502643691,"deps":[[8858041990736880586,"tokio",false,16773703921932670032],[10580169155545709066,"rayon",false,8722109723079235690],[15509557711559852043,"memmap2",false,11400790456180503340],[15966749864389115859,"tokio_util",false,8090137259296688703]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/ext-31fce8d4e5c3b1dc/dep-bin-ext","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1,2 @@
|
||||
{"$message_type":"diagnostic","message":"field `0` is never read","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/main.rs","byte_start":893,"byte_end":899,"line_start":27,"line_end":27,"column_start":8,"column_end":14,"is_primary":false,"text":[{"text":"struct Padded(AtomicU64);","highlight_start":8,"highlight_end":14}],"label":"field in this struct","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/main.rs","byte_start":900,"byte_end":909,"line_start":27,"line_end":27,"column_start":15,"column_end":24,"is_primary":true,"text":[{"text":"struct Padded(AtomicU64);","highlight_start":15,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider removing this field","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"`#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `0` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/main.rs:27:15\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m27\u001b[0m \u001b[1m\u001b[94m|\u001b[0m struct Padded(AtomicU64);\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m------\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: consider removing this field\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default\n\n"}
|
||||
{"$message_type":"diagnostic","message":"1 warning emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: 1 warning emitted\u001b[0m\n\n"}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
1898c3f0146cd648
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[]","declared_features":"[]","target":7756502842689236205,"profile":18001156104845078607,"path":3828132358615678200,"deps":[[8858041990736880586,"tokio",false,16773703921932670032],[10580169155545709066,"rayon",false,8722109723079235690],[15509557711559852043,"memmap2",false,11400790456180503340],[15966749864389115859,"tokio_util",false,8090137259296688703]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/ext-64f0783bf95eb304/dep-example-proxy","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1,2 @@
|
||||
{"$message_type":"diagnostic","message":"field `0` is never read","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"src/main.rs","byte_start":893,"byte_end":899,"line_start":27,"line_end":27,"column_start":8,"column_end":14,"is_primary":false,"text":[{"text":"struct Padded(AtomicU64);","highlight_start":8,"highlight_end":14}],"label":"field in this struct","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/main.rs","byte_start":900,"byte_end":909,"line_start":27,"line_end":27,"column_start":15,"column_end":24,"is_primary":true,"text":[{"text":"struct Padded(AtomicU64);","highlight_start":15,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider removing this field","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"`#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `0` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/main.rs:27:15\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m27\u001b[0m \u001b[1m\u001b[94m|\u001b[0m struct Padded(AtomicU64);\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m------\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mhelp\u001b[0m: consider removing this field\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default\n\n"}
|
||||
{"$message_type":"diagnostic","message":"1 warning emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: 1 warning emitted\u001b[0m\n\n"}
|
||||
@@ -0,0 +1 @@
|
||||
ed3b02b704acb7ce
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[]","declared_features":"[]","target":1652577313445158598,"profile":3759257817629808370,"path":4942398508502643691,"deps":[[8858041990736880586,"tokio",false,16773703921932670032],[10580169155545709066,"rayon",false,8722109723079235690],[15509557711559852043,"memmap2",false,11400790456180503340],[15966749864389115859,"tokio_util",false,8090137259296688703]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/ext-7dd4d952e91ea444/dep-test-bin-ext","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
78c729c968368bde
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[\"alloc\", \"default\", \"std\"]","declared_features":"[\"alloc\", \"cfg-target-has-atomic\", \"default\", \"portable-atomic\", \"std\", \"unstable\"]","target":9453135960607436725,"profile":3664659362302298941,"path":16128456738768362358,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/futures-core-4a6035f4c92d690d/dep-lib-futures_core","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
856597a82afb68b0
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[]","declared_features":"[]","target":10957102547526291127,"profile":10924744486105105859,"path":13019428966468540589,"deps":[[6130475437818347358,"syn",false,11956825975698741808],[8949245912927223590,"quote",false,15534780231842869523],[16346726298725429545,"proc_macro2",false,15284602822849940913]],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/futures-macro-cd0bed6e8ff398fb/dep-lib-futures_macro","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
@@ -0,0 +1 @@
|
||||
9b0e02ba15e84e3b
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc":5244445300240561903,"features":"[\"alloc\", \"default\", \"std\"]","declared_features":"[\"alloc\", \"default\", \"std\"]","target":10827111567014737887,"profile":3664659362302298941,"path":4753097101921653345,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/futures-sink-ba4e1e268b8bfc7d/dep-lib-futures_sink","checksum":false}}],"rustflags":[],"config":9396254390672932401,"compile_kind":0}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user