Trait carboncopy::Sink[][src]

pub trait Sink {
    fn sink_blocking(&self, entry: String) -> Result<()>;
fn sink(&self, entry: String) -> BoxFuture<'_, Result<()>>; }

A trait to be implemented by an external crate whose job is to take an entry (already stringified) and append it to the storage that holds previous log entries.

Required methods

fn sink_blocking(&self, entry: String) -> Result<()>[src]

Sinks a log entry and blocks the current thread while waiting for I/O completion for async blind callers that want to wait for acknowledgment. Example implementation is block_on(/* I/O logic */). Refer to the block_on API offered by tokio, async-std, etc.

fn sink(&self, entry: String) -> BoxFuture<'_, Result<()>>[src]

Sinks a log entry using async I/O and returns a future to be await-ed by the caller. Caller must likely use the same executor as Sink implementation.

Loading content...

Implementors

Loading content...