Trait CacheKey

Source
pub trait CacheKey<M = ()>:
    Debug
    + Invalidatable<M>
    + 'static {
    // Required methods
    fn any(&self) -> &(dyn Any + 'static);
    fn any_eq(&self, other: &dyn Any) -> bool;
    fn any_ord(&self, other: &dyn Any) -> Ordering;
    fn clone_boxed(&self) -> Box<dyn CacheKey<M>>;
}
Expand description

Trait for arbitrary cache keys.

Cache keys are arbitrary Rust types that are sortable and comparable.

Required Methods§

Source

fn any(&self) -> &(dyn Any + 'static)

Source

fn any_eq(&self, other: &dyn Any) -> bool

Source

fn any_ord(&self, other: &dyn Any) -> Ordering

Source

fn clone_boxed(&self) -> Box<dyn CacheKey<M>>

Trait Implementations§

Source§

impl<M: 'static> Clone for Box<dyn CacheKey<M>>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<M: 'static> Ord for dyn CacheKey<M>

Source§

fn cmp(&self, other: &dyn CacheKey<M>) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl<M: 'static> PartialEq for dyn CacheKey<M>

Source§

fn eq(&self, other: &dyn CacheKey<M>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<M: 'static> PartialOrd for dyn CacheKey<M>

Source§

fn partial_cmp(&self, other: &dyn CacheKey<M>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<M: 'static> Eq for dyn CacheKey<M>

Implementors§

Source§

impl<M, T: Debug + Eq + Ord + Any + Clone + Invalidatable<M> + 'static> CacheKey<M> for T