salrucc 0.13.0

Sourced Asynchronous Least Recently Used Cache Control
Documentation
mod cache;
mod queues;

#[cfg(test)]
mod fake_clock;

use std::cmp::Ord;
use std::hash::Hash;
use std::ops::Add;
use std::time::Duration;

/// Trait for implementing clocks
pub trait CacheClock: Send + Sync + 'static {
	type Duration; // Make this default to std::time::Duration when this Rust feature is stable
	type Instant: Clone
		+ Add<Self::Duration, Output = Self::Instant>
		+ Hash
		+ Ord
		+ Send
		+ Sync
		+ 'static;
	fn now(&self) -> Self::Instant;
}

pub type Cache<K, C> = cache::Cache<K, C>;
pub type RetrievalResult<V> = cache::RetrievalResult<V, Duration>;