pub trait ChunkManager {
    fn list_completed(&self) -> Vec<Uuid>;
    fn list_pending(&self) -> Vec<Uuid>;
    fn get(&self, id: Uuid) -> Option<Bytes>;
    fn remove(&mut self, id: Uuid);
    fn remove_expired(&mut self);
    fn handle(&mut self, chunk: Chunk) -> Option<Bytes>;
}
Expand description

A helper for manage chunks and chunk pool

Required Methods§

list completed Chunks;

list pending Chunks;

get sepc msg via uuid if a msg is not completed, it will returns None

remove all chunks of id

remove expired chunks by ttl

handle a chunk

Implementors§