A better Rust ATProto crate

version bumps test fixes

Orual 26d46064 17919b48

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