concread 0.5.10

Concurrently Readable Data-Structures for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Traits for allowing customised behaviours for ARCache

/// A trait that allows custom weighting of items in the arc.
pub trait ArcWeight {
    /// Return the weight of this item. This value MAY be dynamic
    /// as the cache copies this for it's internal tracking purposes
    fn arc_weight(&self) -> usize;
}

impl<T> ArcWeight for T {
    #[inline]
    default fn arc_weight(&self) -> usize {
        1
    }
}