[][src]Trait measureme::SerializationSink

pub trait SerializationSink: Sized + Send + Sync + 'static {
    fn from_path(path: &Path) -> Result<Self, Box<dyn Error>>;
fn write_atomic<W>(&self, num_bytes: usize, write: W) -> Addr
    where
        W: FnOnce(&mut [u8])
; fn write_bytes_atomic(&self, bytes: &[u8]) -> Addr { ... } }

Required methods

fn from_path(path: &Path) -> Result<Self, Box<dyn Error>>

fn write_atomic<W>(&self, num_bytes: usize, write: W) -> Addr where
    W: FnOnce(&mut [u8]), 

Atomically write num_bytes to the sink. The implementation must ensure that concurrent invocations of write_atomic do not conflict with each other.

The write argument is a function that must fill the output buffer passed to it. The output buffer is guaranteed to be exactly num_bytes large.

Loading content...

Provided methods

fn write_bytes_atomic(&self, bytes: &[u8]) -> Addr

Same as write_atomic() but might be faster in cases where bytes to be written are already present in a buffer (as opposed to when it is benefical to directly serialize into the output buffer).

Loading content...

Implementors

impl SerializationSink for ByteVecSink[src]

impl SerializationSink for FileSerializationSink[src]

impl SerializationSink for MmapSerializationSink[src]

Loading content...