Trait ExternalBuffer

Source
pub trait ExternalBuffer<T: Sized>: Send + Sync {
    // Required methods
    fn push(&self, item: T) -> Result<(), Error>;
    fn shift(&self) -> Result<Option<T>, Error>;
}
Expand description

The external buffer here allow us to:

  • save items in an external perssistant storage to achieve crash save for data.
  • even with a in memory buffer, we can still implement a priority queue for push and shift actions.

Required Methods§

Source

fn push(&self, item: T) -> Result<(), Error>

Source

fn shift(&self) -> Result<Option<T>, Error>

Implementors§