[][src]Trait git_odb::pack::cache::DecodeEntry

pub trait DecodeEntry {
    pub fn put(
        &mut self,
        offset: u64,
        data: &[u8],
        kind: Kind,
        compressed_size: usize
    );
pub fn get(
        &mut self,
        offset: u64,
        out: &mut Vec<u8>
    ) -> Option<(Kind, usize)>; }

A trait to model putting objects at a given pack offset into a cache, and fetching them.

It is used to speed up pack traversals.

Required methods

pub fn put(
    &mut self,
    offset: u64,
    data: &[u8],
    kind: Kind,
    compressed_size: usize
)
[src]

Store a fully decoded object at offset of kind with compressed_size and data in the cache.

It is up to the cache implementation whether that actually happens or not.

pub fn get(&mut self, offset: u64, out: &mut Vec<u8>) -> Option<(Kind, usize)>[src]

Attempt to fetch the object at offset and store its decoded bytes in out, as previously stored with DecodeEntry::put(), and return its (object kind, decompressed_size)

Loading content...

Implementors

impl DecodeEntry for LRU[src]

impl DecodeEntry for Noop[src]

Loading content...