A better Rust ATProto crate

version bumps test fixes

+1 -1
.tangled/workflows/build.yml
··· 21 22 - name: run tests 23 command: | 24 - cargo test
··· 21 22 - name: run tests 23 command: | 24 + cargo test -- --skip common::frequency_sketch
+1 -1
Cargo.lock
··· 2581 2582 [[package]] 2583 name = "jacquard-oauth" 2584 - version = "0.9.5" 2585 dependencies = [ 2586 "base64 0.22.1", 2587 "bytes",
··· 2581 2582 [[package]] 2583 name = "jacquard-oauth" 2584 + version = "0.9.6" 2585 dependencies = [ 2586 "base64 0.22.1", 2587 "bytes",
+6 -6
binaries/SHA256SUMS
··· 1 - e9ce1e407dc6621bed73dbb3f02d2e3b56f083e6cf1a940417ec9b3a0924bca1 jacquard-codegen_aarch64-unknown-linux-gnu.tar.xz 2 - 6a24691500f8ab5579cf88fc575b5fe4bf92fb3b508cf7f6f4bacf3801a19a99 jacquard-codegen_x86_64-unknown-linux-gnu.tar.xz 3 - a8880094d84c1bf2d6b55fb65101fe58543031ce394f0580457602edc70f0b46 lex-fetch_aarch64-unknown-linux-gnu.tar.xz 4 - d27f44d79ee801a8c96ede94b4873d40e611390360c96a01b07d01370a914c9c lex-fetch_x86_64-unknown-linux-gnu.tar.xz 5 - 39577227b8561465c81d81f6d49037a5c9ce3d0c3e20390c60e128a326f96746 jacquard-codegen_x86_64-pc-windows-gnu.zip 6 - 5a376cc2e59f45ba9861fac448522e56378acab89b305823824970f8d01b3002 lex-fetch_x86_64-pc-windows-gnu.zip
··· 1 + 4cee5d4386394d5de7c3bf958a8697331468be29b1a0287ede7e7777a3e133cc jacquard-codegen_aarch64-unknown-linux-gnu.tar.xz 2 + 0ae250caacabaf1fbd96e7a09b726863ce1050b3914c0124c1e928a693282aff jacquard-codegen_x86_64-unknown-linux-gnu.tar.xz 3 + 7f1424e93f16b8e506b0d7fc72f4afa85262dfda074e06e37419e77be49e293c lex-fetch_aarch64-unknown-linux-gnu.tar.xz 4 + 59d6f3acfbfdc4ef492745ef56fcbe112cde83e67b672cd1396daeee164c487c lex-fetch_x86_64-unknown-linux-gnu.tar.xz 5 + 777ef7d9a7a4e327d88a738b9d82b50ae57b571cd5e271b09616022e2b420587 jacquard-codegen_x86_64-pc-windows-gnu.zip 6 + f36d0c89e7e6db54ef79c18eccfc400cd4a107eb2cfe2e4e09e080cefc17d96f lex-fetch_x86_64-pc-windows-gnu.zip
binaries/jacquard-codegen_aarch64-unknown-linux-gnu.tar.xz

This is a binary file and will not be displayed.

binaries/jacquard-codegen_x86_64-pc-windows-gnu.zip

This is a binary file and will not be displayed.

binaries/jacquard-codegen_x86_64-unknown-linux-gnu.tar.xz

This is a binary file and will not be displayed.

binaries/lex-fetch_aarch64-unknown-linux-gnu.tar.xz

This is a binary file and will not be displayed.

binaries/lex-fetch_x86_64-pc-windows-gnu.zip

This is a binary file and will not be displayed.

binaries/lex-fetch_x86_64-unknown-linux-gnu.tar.xz

This is a binary file and will not be displayed.

+1 -1
crates/jacquard-oauth/Cargo.toml
··· 1 [package] 2 name = "jacquard-oauth" 3 - version = "0.9.5" 4 edition.workspace = true 5 description = "AT Protocol OAuth 2.1 core types and helpers for Jacquard" 6 authors.workspace = true
··· 1 [package] 2 name = "jacquard-oauth" 3 + version = "0.9.6" 4 edition.workspace = true 5 description = "AT Protocol OAuth 2.1 core types and helpers for Jacquard" 6 authors.workspace = true
+1 -1
crates/jacquard/src/client.rs
··· 442 /// # #[tokio::main] 443 /// # async fn main() -> Result<(), Box<dyn std::error::Error>> { 444 /// # let (identifier, password, post_text): (CowStr<'_>, CowStr<'_>, CowStr<'_>) = todo!(); 445 - /// let (session, _) = MemoryCredentialSession::authenticated(identifier, password, None).await?; 446 /// let agent = Agent::from(session); 447 /// let post = Post::new().text(post_text).created_at(Datetime::now()).build(); 448 /// let output = agent.create_record(post, None).await?;
··· 442 /// # #[tokio::main] 443 /// # async fn main() -> Result<(), Box<dyn std::error::Error>> { 444 /// # let (identifier, password, post_text): (CowStr<'_>, CowStr<'_>, CowStr<'_>) = todo!(); 445 + /// let (session, _) = MemoryCredentialSession::authenticated(identifier, password, None, None).await?; 446 /// let agent = Agent::from(session); 447 /// let post = Post::new().text(post_text).created_at(Datetime::now()).build(); 448 /// let output = agent.create_record(post, None).await?;
+3 -3
crates/mini-moka-wasm/README.md
··· 111 112 ```rust 113 // Use the synchronous cache. 114 - use mini_moka::sync::Cache; 115 116 use std::thread; 117 ··· 206 207 ```rust 208 use std::convert::TryInto; 209 - use mini_moka::sync::Cache; 210 211 fn main() { 212 let cache = Cache::builder() ··· 238 To set them, use the `CacheBuilder`. 239 240 ```rust 241 - use mini_moka::sync::Cache; 242 use std::time::Duration; 243 244 fn main() {
··· 111 112 ```rust 113 // Use the synchronous cache. 114 + use mini_moka_wasm::sync::Cache; 115 116 use std::thread; 117 ··· 206 207 ```rust 208 use std::convert::TryInto; 209 + use mini_moka_wasm::sync::Cache; 210 211 fn main() { 212 let cache = Cache::builder() ··· 238 To set them, use the `CacheBuilder`. 239 240 ```rust 241 + use mini_moka_wasm::sync::Cache; 242 use std::time::Duration; 243 244 fn main() {
+1 -1
crates/mini-moka-wasm/src/sync/builder.rs
··· 15 /// # Examples 16 /// 17 /// ```rust 18 - /// use mini_moka::sync::Cache; 19 /// use std::time::Duration; 20 /// 21 /// let cache = Cache::builder()
··· 15 /// # Examples 16 /// 17 /// ```rust 18 + /// use mini_moka_wasm::sync::Cache; 19 /// use std::time::Duration; 20 /// 21 /// let cache = Cache::builder()
+9 -9
crates/mini-moka-wasm/src/sync/cache.rs
··· 1 - use super::{base_cache::BaseCache, CacheBuilder, ConcurrentCacheExt, EntryRef, Iter}; 2 use crate::{ 3 common::{ 4 concurrent::{ 5 constants::{MAX_SYNC_REPEATS, WRITE_RETRY_INTERVAL_MICROS}, 6 housekeeper::{Housekeeper, InnerSync}, 7 - Weigher, WriteOp, 8 }, 9 time::Duration, 10 time::Instant, 11 }, 12 - Policy, 13 }; 14 15 use crossbeam_channel::{Sender, TrySendError}; ··· 39 /// Here's an example of reading and updating a cache by using multiple threads: 40 /// 41 /// ```rust 42 - /// use mini_moka::sync::Cache; 43 /// 44 /// use std::thread; 45 /// ··· 110 /// 111 /// ```rust 112 /// use std::convert::TryInto; 113 - /// use mini_moka::sync::Cache; 114 /// 115 /// // Evict based on the number of entries in the cache. 116 /// let cache = Cache::builder() ··· 161 /// past from `get` or `insert`. 162 /// 163 /// ```rust 164 - /// use mini_moka::sync::Cache; 165 /// use std::time::Duration; 166 /// 167 /// let cache = Cache::builder() ··· 321 /// # Example 322 /// 323 /// ```rust 324 - /// use mini_moka::sync::Cache; 325 /// 326 /// let cache = Cache::new(10); 327 /// cache.insert('n', "Netherland Dwarf"); ··· 337 /// 338 /// // To mitigate the inaccuracy, bring `ConcurrentCacheExt` trait to 339 /// // the scope so we can use `sync` method. 340 - /// use mini_moka::sync::ConcurrentCacheExt; 341 /// // Call `sync` to run pending internal tasks. 342 /// cache.sync(); 343 /// ··· 521 /// # Examples 522 /// 523 /// ```rust 524 - /// use mini_moka::sync::Cache; 525 /// 526 /// let cache = Cache::new(100); 527 /// cache.insert("Julia", 14);
··· 1 + use super::{CacheBuilder, ConcurrentCacheExt, EntryRef, Iter, base_cache::BaseCache}; 2 use crate::{ 3 + Policy, 4 common::{ 5 concurrent::{ 6 + Weigher, WriteOp, 7 constants::{MAX_SYNC_REPEATS, WRITE_RETRY_INTERVAL_MICROS}, 8 housekeeper::{Housekeeper, InnerSync}, 9 }, 10 time::Duration, 11 time::Instant, 12 }, 13 }; 14 15 use crossbeam_channel::{Sender, TrySendError}; ··· 39 /// Here's an example of reading and updating a cache by using multiple threads: 40 /// 41 /// ```rust 42 + /// use mini_moka_wasm::sync::Cache; 43 /// 44 /// use std::thread; 45 /// ··· 110 /// 111 /// ```rust 112 /// use std::convert::TryInto; 113 + /// use mini_moka_wasm::sync::Cache; 114 /// 115 /// // Evict based on the number of entries in the cache. 116 /// let cache = Cache::builder() ··· 161 /// past from `get` or `insert`. 162 /// 163 /// ```rust 164 + /// use mini_moka_wasm::sync::Cache; 165 /// use std::time::Duration; 166 /// 167 /// let cache = Cache::builder() ··· 321 /// # Example 322 /// 323 /// ```rust 324 + /// use mini_moka_wasm::sync::Cache; 325 /// 326 /// let cache = Cache::new(10); 327 /// cache.insert('n', "Netherland Dwarf"); ··· 337 /// 338 /// // To mitigate the inaccuracy, bring `ConcurrentCacheExt` trait to 339 /// // the scope so we can use `sync` method. 340 + /// use mini_moka_wasm::sync::ConcurrentCacheExt; 341 /// // Call `sync` to run pending internal tasks. 342 /// cache.sync(); 343 /// ··· 521 /// # Examples 522 /// 523 /// ```rust 524 + /// use mini_moka_wasm::sync::Cache; 525 /// 526 /// let cache = Cache::new(100); 527 /// cache.insert("Julia", 14);
+1 -1
crates/mini-moka-wasm/src/unsync/builder.rs
··· 15 /// # Examples 16 /// 17 /// ```rust 18 - /// use mini_moka::unsync::Cache; 19 /// use std::time::Duration; 20 /// 21 /// let mut cache = Cache::builder()
··· 15 /// # Examples 16 /// 17 /// ```rust 18 + /// use mini_moka_wasm::unsync::Cache; 19 /// use std::time::Duration; 20 /// 21 /// let mut cache = Cache::builder()
+8 -9
crates/mini-moka-wasm/src/unsync/cache.rs
··· 1 use super::{ 2 - deques::Deques, AccessTime, CacheBuilder, Iter, KeyDate, KeyHashDate, ValueEntry, Weigher, 3 }; 4 use crate::{ 5 common::{ 6 - self, 7 deque::{DeqNode, Deque}, 8 frequency_sketch::FrequencySketch, 9 time::{CheckedTimeOps, Clock, Instant}, 10 - CacheRegion, 11 }, 12 - Policy, 13 }; 14 15 use smallvec::SmallVec; 16 use std::{ 17 borrow::Borrow, 18 - collections::{hash_map::RandomState, HashMap}, 19 fmt, 20 hash::{BuildHasher, Hash}, 21 ptr::NonNull, ··· 55 /// Here's an example of reading and updating a cache by using the main thread: 56 /// 57 ///```rust 58 - /// use mini_moka::unsync::Cache; 59 /// 60 /// const NUM_KEYS: usize = 64; 61 /// ··· 90 /// 91 /// ```rust 92 /// use std::convert::TryInto; 93 - /// use mini_moka::unsync::Cache; 94 /// 95 /// // Evict based on the number of entries in the cache. 96 /// let mut cache = Cache::builder() ··· 238 /// # Example 239 /// 240 /// ```rust 241 - /// use mini_moka::unsync::Cache; 242 /// 243 /// let mut cache = Cache::new(10); 244 /// cache.insert('n', "Netherland Dwarf"); ··· 492 /// # Examples 493 /// 494 /// ```rust 495 - /// use mini_moka::unsync::Cache; 496 /// 497 /// let mut cache = Cache::new(100); 498 /// cache.insert("Julia", 14);
··· 1 use super::{ 2 + AccessTime, CacheBuilder, Iter, KeyDate, KeyHashDate, ValueEntry, Weigher, deques::Deques, 3 }; 4 use crate::{ 5 + Policy, 6 common::{ 7 + self, CacheRegion, 8 deque::{DeqNode, Deque}, 9 frequency_sketch::FrequencySketch, 10 time::{CheckedTimeOps, Clock, Instant}, 11 }, 12 }; 13 14 use smallvec::SmallVec; 15 use std::{ 16 borrow::Borrow, 17 + collections::{HashMap, hash_map::RandomState}, 18 fmt, 19 hash::{BuildHasher, Hash}, 20 ptr::NonNull, ··· 54 /// Here's an example of reading and updating a cache by using the main thread: 55 /// 56 ///```rust 57 + /// use mini_moka_wasm::unsync::Cache; 58 /// 59 /// const NUM_KEYS: usize = 64; 60 /// ··· 89 /// 90 /// ```rust 91 /// use std::convert::TryInto; 92 + /// use mini_moka_wasm::unsync::Cache; 93 /// 94 /// // Evict based on the number of entries in the cache. 95 /// let mut cache = Cache::builder() ··· 237 /// # Example 238 /// 239 /// ```rust 240 + /// use mini_moka_wasm::unsync::Cache; 241 /// 242 /// let mut cache = Cache::new(10); 243 /// cache.insert('n', "Netherland Dwarf"); ··· 491 /// # Examples 492 /// 493 /// ```rust 494 + /// use mini_moka_wasm::unsync::Cache; 495 /// 496 /// let mut cache = Cache::new(100); 497 /// cache.insert("Julia", 14);
+1 -1
crates/mini-moka-wasm/tests/compile_tests/sync/clone/sync_cache_clone.rs
··· 2 3 use std::{collections::hash_map::DefaultHasher, hash::BuildHasher, sync::Arc}; 4 5 - use mini_moka::sync::Cache; 6 7 fn main() { 8 f1_fail();
··· 2 3 use std::{collections::hash_map::DefaultHasher, hash::BuildHasher, sync::Arc}; 4 5 + use mini_moka_wasm::sync::Cache; 6 7 fn main() { 8 f1_fail();
+4 -4
crates/mini-moka-wasm/tests/compile_tests/sync/clone/sync_cache_clone.stderr
··· 4 18 | let _cache: Cache<MyKey, MyValue> = Cache::new(CAP); 5 | ^^^^^^^^^^ the trait `Clone` is not implemented for `MyValue` 6 | 7 - note: required by a bound in `mini_moka::sync::Cache::<K, V>::new` 8 --> src/sync/cache.rs 9 | 10 | V: Clone + Send + Sync + 'static, 11 - | ^^^^^ required by this bound in `mini_moka::sync::Cache::<K, V>::new` 12 help: consider annotating `MyValue` with `#[derive(Clone)]` 13 | 14 41 | #[derive(Clone)] ··· 22 | | 23 | required by a bound introduced by this call 24 | 25 - note: required by a bound in `mini_moka::sync::CacheBuilder::<K, V, mini_moka::sync::Cache<K, V>>::build_with_hasher` 26 --> src/sync/builder.rs 27 | 28 | S: BuildHasher + Clone + Send + Sync + 'static, 29 - | ^^^^^ required by this bound in `mini_moka::sync::CacheBuilder::<K, V, mini_moka::sync::Cache<K, V>>::build_with_hasher` 30 help: consider annotating `MyBuildHasher1` with `#[derive(Clone)]` 31 | 32 44 | #[derive(Clone)]
··· 4 18 | let _cache: Cache<MyKey, MyValue> = Cache::new(CAP); 5 | ^^^^^^^^^^ the trait `Clone` is not implemented for `MyValue` 6 | 7 + note: required by a bound in `mini_moka_wasm::sync::Cache::<K, V>::new` 8 --> src/sync/cache.rs 9 | 10 | V: Clone + Send + Sync + 'static, 11 + | ^^^^^ required by this bound in `mini_moka_wasm::sync::Cache::<K, V>::new` 12 help: consider annotating `MyValue` with `#[derive(Clone)]` 13 | 14 41 | #[derive(Clone)] ··· 22 | | 23 | required by a bound introduced by this call 24 | 25 + note: required by a bound in `mini_moka_wasm::sync::CacheBuilder::<K, V, mini_moka_wasm::sync::Cache<K, V>>::build_with_hasher` 26 --> src/sync/builder.rs 27 | 28 | S: BuildHasher + Clone + Send + Sync + 'static, 29 + | ^^^^^ required by this bound in `mini_moka_wasm::sync::CacheBuilder::<K, V, mini_moka::sync::Cache<K, V>>::build_with_hasher` 30 help: consider annotating `MyBuildHasher1` with `#[derive(Clone)]` 31 | 32 44 | #[derive(Clone)]