+4
-4
Cargo.lock
+4
-4
Cargo.lock
···
2262
2262
2263
2263
[[package]]
2264
2264
name = "jacquard"
2265
-
version = "0.9.3"
2265
+
version = "0.9.4"
2266
2266
dependencies = [
2267
2267
"bytes",
2268
2268
"clap",
···
2389
2389
2390
2390
[[package]]
2391
2391
name = "jacquard-derive"
2392
-
version = "0.9.3"
2392
+
version = "0.9.4"
2393
2393
dependencies = [
2394
2394
"heck 0.5.0",
2395
2395
"inventory",
···
2432
2432
2433
2433
[[package]]
2434
2434
name = "jacquard-lexgen"
2435
-
version = "0.9.3"
2435
+
version = "0.9.4"
2436
2436
dependencies = [
2437
2437
"clap",
2438
2438
"clap_complete",
···
2519
2519
2520
2520
[[package]]
2521
2521
name = "jacquard-repo"
2522
-
version = "0.9.3"
2522
+
version = "0.9.4"
2523
2523
dependencies = [
2524
2524
"anyhow",
2525
2525
"bytes",
+42
-41
crates/jacquard-identity/src/lib.rs
+42
-41
crates/jacquard-identity/src/lib.rs
···
100
100
use {
101
101
crate::lexicon_resolver::ResolvedLexiconSchema,
102
102
jacquard_common::{smol_str::SmolStr, types::string::Nsid},
103
-
std::time::Duration,
103
+
mini_moka::time::Duration,
104
104
};
105
105
106
106
#[cfg(all(
···
110
110
use std::sync::Arc;
111
111
112
112
// Platform-specific cache implementations
113
-
#[cfg(all(feature = "cache", not(target_arch = "wasm32")))]
113
+
//#[cfg(all(feature = "cache", not(target_arch = "wasm32")))]
114
+
#[cfg(feature = "cache")]
114
115
mod cache_impl {
115
116
/// Native: Use sync cache (thread-safe, no mutex needed)
116
117
pub type Cache<K, V> = mini_moka::sync::Cache<K, V>;
···
151
152
}
152
153
}
153
154
154
-
#[cfg(all(feature = "cache", target_arch = "wasm32"))]
155
-
mod cache_impl {
156
-
use std::sync::{Arc, Mutex};
155
+
// #[cfg(all(feature = "cache", target_arch = "wasm32"))]
156
+
// mod cache_impl {
157
+
// use std::sync::{Arc, Mutex};
157
158
158
-
/// WASM: Use unsync cache in Arc<Mutex<_>> (no threads, but need interior mutability)
159
-
pub type Cache<K, V> = Arc<Mutex<mini_moka::unsync::Cache<K, V>>>;
159
+
// /// WASM: Use unsync cache in Arc<Mutex<_>> (no threads, but need interior mutability)
160
+
// pub type Cache<K, V> = Arc<Mutex<mini_moka::unsync::Cache<K, V>>>;
160
161
161
-
pub fn new_cache<K, V>(max_capacity: u64, ttl: std::time::Duration) -> Cache<K, V>
162
-
where
163
-
K: std::hash::Hash + Eq + 'static,
164
-
V: Clone + 'static,
165
-
{
166
-
Arc::new(Mutex::new(
167
-
mini_moka::unsync::Cache::builder()
168
-
.max_capacity(max_capacity)
169
-
.time_to_idle(ttl)
170
-
.build(),
171
-
))
172
-
}
162
+
// pub fn new_cache<K, V>(max_capacity: u64, ttl: std::time::Duration) -> Cache<K, V>
163
+
// where
164
+
// K: std::hash::Hash + Eq + 'static,
165
+
// V: Clone + 'static,
166
+
// {
167
+
// Arc::new(Mutex::new(
168
+
// mini_moka::unsync::Cache::builder()
169
+
// .max_capacity(max_capacity)
170
+
// .time_to_idle(ttl)
171
+
// .build(),
172
+
// ))
173
+
// }
173
174
174
-
pub fn get<K, V>(cache: &Cache<K, V>, key: &K) -> Option<V>
175
-
where
176
-
K: std::hash::Hash + Eq + 'static,
177
-
V: Clone + 'static,
178
-
{
179
-
cache.lock().unwrap().get(key).cloned()
180
-
}
175
+
// pub fn get<K, V>(cache: &Cache<K, V>, key: &K) -> Option<V>
176
+
// where
177
+
// K: std::hash::Hash + Eq + 'static,
178
+
// V: Clone + 'static,
179
+
// {
180
+
// cache.lock().unwrap().get(key).cloned()
181
+
// }
181
182
182
-
pub fn insert<K, V>(cache: &Cache<K, V>, key: K, value: V)
183
-
where
184
-
K: std::hash::Hash + Eq + 'static,
185
-
V: Clone + 'static,
186
-
{
187
-
cache.lock().unwrap().insert(key, value);
188
-
}
183
+
// pub fn insert<K, V>(cache: &Cache<K, V>, key: K, value: V)
184
+
// where
185
+
// K: std::hash::Hash + Eq + 'static,
186
+
// V: Clone + 'static,
187
+
// {
188
+
// cache.lock().unwrap().insert(key, value);
189
+
// }
189
190
190
-
pub fn invalidate<K, V>(cache: &Cache<K, V>, key: &K)
191
-
where
192
-
K: std::hash::Hash + Eq + 'static,
193
-
V: Clone + 'static,
194
-
{
195
-
cache.lock().unwrap().invalidate(key);
196
-
}
197
-
}
191
+
// pub fn invalidate<K, V>(cache: &Cache<K, V>, key: &K)
192
+
// where
193
+
// K: std::hash::Hash + Eq + 'static,
194
+
// V: Clone + 'static,
195
+
// {
196
+
// cache.lock().unwrap().invalidate(key);
197
+
// }
198
+
// }
198
199
199
200
/// Configuration for resolver caching
200
201
#[cfg(feature = "cache")]
+1
crates/jacquard-oauth/src/resolver.rs
+1
crates/jacquard-oauth/src/resolver.rs
···
5
5
use http::{Request, StatusCode};
6
6
use jacquard_common::CowStr;
7
7
use jacquard_common::IntoStatic;
8
+
use jacquard_common::cowstr::ToCowStr;
8
9
use jacquard_common::types::did_doc::DidDocument;
9
10
use jacquard_common::types::ident::AtIdentifier;
10
11
use jacquard_common::{http_client::HttpClient, types::did::Did};
+1
-1
crates/mini-moka-vendored/src/common.rs
+1
-1
crates/mini-moka-vendored/src/common.rs
···
6
6
pub(crate) mod builder_utils;
7
7
pub(crate) mod deque;
8
8
pub(crate) mod frequency_sketch;
9
-
pub(crate) mod time;
9
+
pub mod time;
10
10
11
11
// Note: `CacheRegion` cannot have more than four enum variants. This is because
12
12
// `crate::{sync,unsync}::DeqNodes` uses a `tagptr::TagNonNull<DeqNode<T>, 2>`
+2
-5
crates/mini-moka-vendored/src/common/concurrent/housekeeper.rs
+2
-5
crates/mini-moka-vendored/src/common/concurrent/housekeeper.rs
···
6
6
},
7
7
};
8
8
9
-
use crate::common::time::{CheckedTimeOps, Instant};
9
+
use crate::common::time::{CheckedTimeOps, Duration, Instant};
10
10
11
-
use std::{
12
-
sync::atomic::{AtomicBool, Ordering},
13
-
time::Duration,
14
-
};
11
+
use std::sync::atomic::{AtomicBool, Ordering};
15
12
16
13
pub(crate) trait InnerSync {
17
14
fn sync(&self, max_sync_repeats: usize);
+5
-1
crates/mini-moka-vendored/src/common/time.rs
+5
-1
crates/mini-moka-vendored/src/common/time.rs
+2
crates/mini-moka-vendored/src/lib.rs
+2
crates/mini-moka-vendored/src/lib.rs
+1
-2
crates/mini-moka-vendored/src/sync/base_cache.rs
+1
-2
crates/mini-moka-vendored/src/sync/base_cache.rs
···
15
15
},
16
16
deque::{DeqNode, Deque},
17
17
frequency_sketch::FrequencySketch,
18
-
time::{CheckedTimeOps, Clock, Instant},
18
+
time::{CheckedTimeOps, Clock, Duration, Instant},
19
19
CacheRegion,
20
20
},
21
21
Policy,
···
34
34
atomic::{AtomicBool, Ordering},
35
35
Arc, Mutex, RwLock,
36
36
},
37
-
time::Duration,
38
37
};
39
38
use triomphe::Arc as TrioArc;
40
39
+1
-2
crates/mini-moka-vendored/src/sync/builder.rs
+1
-2
crates/mini-moka-vendored/src/sync/builder.rs
···
1
1
use super::Cache;
2
-
use crate::{common::builder_utils, common::concurrent::Weigher};
2
+
use crate::{common::builder_utils, common::concurrent::Weigher, common::time::Duration};
3
3
4
4
use std::{
5
5
collections::hash_map::RandomState,
6
6
hash::{BuildHasher, Hash},
7
7
marker::PhantomData,
8
8
sync::Arc,
9
-
time::Duration,
10
9
};
11
10
12
11
/// Builds a [`Cache`][cache-struct] or with various configuration knobs.
+1
-1
crates/mini-moka-vendored/src/sync/cache.rs
+1
-1
crates/mini-moka-vendored/src/sync/cache.rs
···
6
6
housekeeper::{Housekeeper, InnerSync},
7
7
Weigher, WriteOp,
8
8
},
9
+
time::Duration,
9
10
time::Instant,
10
11
},
11
12
Policy,
···
18
19
fmt,
19
20
hash::{BuildHasher, Hash},
20
21
sync::Arc,
21
-
time::Duration,
22
22
};
23
23
24
24
/// A thread-safe concurrent in-memory cache built upon [`dashmap::DashMap`][dashmap].
+1
-1
examples/app_password_create_post.rs
+1
-1
examples/app_password_create_post.rs
···
23
23
let args = Args::parse();
24
24
25
25
let (session, auth) =
26
-
MemoryCredentialSession::authenticated(args.input, args.password, None).await?;
26
+
MemoryCredentialSession::authenticated(args.input, args.password, None, None).await?;
27
27
println!("Signed in as {}", auth.handle);
28
28
29
29
let agent: Agent<_> = Agent::from(session);