pub trait LayerWriter<K, V>: Sized{
// Required methods
fn write(
&mut self,
item: ItemRef<'_, K, V>,
) -> impl Future<Output = Result<(), Error>> + Send;
fn flush(&mut self) -> impl Future<Output = Result<(), Error>> + Send;
fn bytes_written(&self) -> u64;
}Expand description
Trait for writing new layers.
Required Methods§
Sourcefn write(
&mut self,
item: ItemRef<'_, K, V>,
) -> impl Future<Output = Result<(), Error>> + Send
fn write( &mut self, item: ItemRef<'_, K, V>, ) -> impl Future<Output = Result<(), Error>> + Send
Writes the given item to this layer.
Sourcefn flush(&mut self) -> impl Future<Output = Result<(), Error>> + Send
fn flush(&mut self) -> impl Future<Output = Result<(), Error>> + Send
Flushes any buffered items to the backing storage.
Sourcefn bytes_written(&self) -> u64
fn bytes_written(&self) -> u64
Returns the total bytes written to the layer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.