wrc 0.2.0

A thread-safe weighted reference counting smart-pointer for Rust.
1
2
3
4
5
6
7
8
9
10
11

pub trait Weight {
    /// Add weight to the existing weight value, with overflow checking.
    fn add_weight(&self, usize) -> Option<usize>;

    /// Subtract weight to the existing weight value, with overflow checking.
    fn drop_weight(&self, usize) -> Option<usize>;

    /// Get the weight of the value.
    fn get_weight(&self) -> usize;
}