Expand description
Lock-aware querying for thread-safe data structures.
This module provides support for querying data behind locks (RwLock, Mutex) without copying. It works with both std and tokio locks (when enabled).
§Features
- Query
Arc<RwLock<T>>andArc<Mutex<T>>directly - No data copying - works with lock guards
- Extensible for tokio::sync locks
- Works with HashMap, Vec, and other collections of locks
§Example
ⓘ
use std::sync::{Arc, RwLock};
use std::collections::HashMap;
use rust_queries_core::{locks::LockQueryExt, LazyQuery};
type ProductMap = HashMap<String, Arc<RwLock<Product>>>;
let products: ProductMap = /* ... */;
// Query without copying!
let electronics: Vec<_> = products
.query_locks()
.where_(Product::category(), |cat| cat == "Electronics")
.collect();Structs§
- Lock
Filter Iter - Iterator adapter for filtering locked values.
- Locked
Value Ref - A reference to a value behind a lock.
Traits§
- Lock
Iter Ext - Extension methods for lock iterators.
- Lock
Query Ext - Extension trait for querying collections of locks.
- Lock
Value - Helper trait for lock-aware value extraction.