Trait ccache::hashmap::user::EntryT[][src]

pub trait EntryT<K, V, Cid, Umeta>: Default where
    K: Default,
    V: Val,
    Cid: Cid,
    Umeta: Meta<V>,
    Self: Sized
{
Show methods fn new_entry(
        head: Option<NonNull<Self>>,
        tail: Option<NonNull<Self>>,
        key: K,
        val: V,
        cache_id: Cid,
        user_data: Umeta
    ) -> Self;
fn get_head_ptr(&self) -> Option<NonNull<Self>>;
fn set_head_ptr(&mut self, head: Option<NonNull<Self>>);
fn get_tail_ptr(&self) -> Option<NonNull<Self>>;
fn set_tail_ptr(&mut self, tail: Option<NonNull<Self>>);
fn get_key(&self) -> &K;
fn get_val(&self) -> &V;
fn get_val_mut(&mut self) -> &mut V;
fn get_cache_id(&self) -> Cid;
fn get_cache_id_mut(&mut self) -> &mut Cid;
fn deconstruct(self) -> (K, V, Umeta);
fn get_user(&self) -> &Umeta;
fn get_user_mut(&mut self) -> &mut Umeta;
fn get_val_user_mut(&mut self) -> (&mut V, &mut Umeta);
fn user_on_insert(&mut self, old_entry: Option<&mut Self>);
fn user_on_get(&mut self);
}

Trait to reimplement for the hashmap Entry

Required methods

fn new_entry(
    head: Option<NonNull<Self>>,
    tail: Option<NonNull<Self>>,
    key: K,
    val: V,
    cache_id: Cid,
    user_data: Umeta
) -> Self
[src]

returns an entry with the given values

fn get_head_ptr(&self) -> Option<NonNull<Self>>[src]

Get the pointer to a value higher in the cache

fn set_head_ptr(&mut self, head: Option<NonNull<Self>>)[src]

Set the pointer to a value higher in the cacheì

fn get_tail_ptr(&self) -> Option<NonNull<Self>>[src]

Get the pointer to a value lower in the cache

fn set_tail_ptr(&mut self, tail: Option<NonNull<Self>>)[src]

Set the pointer to a value lower in the cacheì

fn get_key(&self) -> &K[src]

get a reference to the key

fn get_val(&self) -> &V[src]

get a reference to the value

fn get_val_mut(&mut self) -> &mut V[src]

get a mutable reference to the value

fn get_cache_id(&self) -> Cid[src]

get the cache id

fn get_cache_id_mut(&mut self) -> &mut Cid[src]

get a mutable cache id

fn deconstruct(self) -> (K, V, Umeta)[src]

return all the basic components of an entry

fn get_user(&self) -> &Umeta[src]

get a reference to the metadata for the entry

fn get_user_mut(&mut self) -> &mut Umeta[src]

get a mutable reference to the metadata for the entry

fn get_val_user_mut(&mut self) -> (&mut V, &mut Umeta)[src]

get mutable references to both value and metadata

fn user_on_insert(&mut self, old_entry: Option<&mut Self>)[src]

Run the on-insert callback on this entry.

Optionally get a ref to the old value if there was a clash

fn user_on_get(&mut self)[src]

Run the on-get callback on the entry

Loading content...

Implementors

impl<K, V, Cid, Umeta: Meta<V>> EntryT<K, V, Cid, Umeta> for Entry<K, V, Cid, Umeta> where
    K: Hash,
    V: Val,
    Cid: Cid
[src]

Loading content...