Trait gix_pack::cache::Object

source ·
pub trait Object {
    // Required methods
    fn put(&mut self, id: ObjectId, kind: Kind, data: &[u8]);
    fn get(&mut self, id: &ObjectId, out: &mut Vec<u8>) -> Option<Kind>;
}
Expand description

A way of storing and retrieving entire objects to and from a cache.

Required Methods§

source

fn put(&mut self, id: ObjectId, kind: Kind, data: &[u8])

Put the object going by id of kind with data into the cache.

source

fn get(&mut self, id: &ObjectId, out: &mut Vec<u8>) -> Option<Kind>

Try to retrieve the object named id and place its data into out if available and return Some(kind) if found.

Implementations on Foreign Types§

source§

impl<T: Object + ?Sized> Object for Box<T>

source§

fn put(&mut self, id: ObjectId, kind: Kind, data: &[u8])

source§

fn get(&mut self, id: &ObjectId, out: &mut Vec<u8>) -> Option<Kind>

Implementors§

source§

impl Object for MemoryCappedHashmap

Available on crate feature object-cache-dynamic only.
source§

impl Object for Never