pub trait ChunkManager {
    // Required methods
    fn list_completed(&self) -> Vec<Uuid, Global>;
    fn list_pending(&self) -> Vec<Uuid, Global>;
    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§

source

fn list_completed(&self) -> Vec<Uuid, Global>

list completed Chunks;

source

fn list_pending(&self) -> Vec<Uuid, Global>

list pending Chunks;

source

fn get(&self, id: Uuid) -> Option<Bytes>

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

source

fn remove(&mut self, id: Uuid)

remove all chunks of id

source

fn remove_expired(&mut self)

remove expired chunks by ttl

source

fn handle(&mut self, chunk: Chunk) -> Option<Bytes>

handle a chunk

Implementors§

source§

impl<const MTU: usize> ChunkManager for ChunkList<MTU>