Skip to main content

DataWriter

Trait DataWriter 

Source
pub trait DataWriter: Send + Sync {
    // Required methods
    fn write(&self, payload: &[u8]) -> Result<()>;
    fn write_with_timestamp(
        &self,
        payload: &[u8],
        timestamp_ns: u64,
    ) -> Result<()>;
    fn topic(&self) -> &str;
    fn type_name(&self) -> &str;
}
Expand description

Abstract data writer interface

Required Methods§

Source

fn write(&self, payload: &[u8]) -> Result<()>

Write a sample

Source

fn write_with_timestamp(&self, payload: &[u8], timestamp_ns: u64) -> Result<()>

Write a sample with timestamp

Source

fn topic(&self) -> &str

Get topic name

Source

fn type_name(&self) -> &str

Get type name

Implementors§