[][src]Trait streamson_lib::handler::Handler

pub trait Handler: Send {
    fn handle(&mut self, path: &str, data: &[u8]) -> Result<(), Handler>;

    fn show_path(&self) -> bool { ... }
fn separator(&self) -> &str { ... } }

Common handler trait

Required methods

fn handle(&mut self, path: &str, data: &[u8]) -> Result<(), Handler>

Calls handler on splitted data

Arguments

  • path - path which was matched
  • data - matched data

Returns

  • Ok(()) - Handler was successfully executed
  • Err(_) - Failed to execute handler

Errors

Handler failed (e.g. failed to write to output file).

Loading content...

Provided methods

fn show_path(&self) -> bool

Should path be displayed in the output

fn separator(&self) -> &str

A str which will be used to separate records

Loading content...

Implementors

impl Handler for Buffer[src]

impl Handler for File[src]

impl Handler for PrintLn[src]

Loading content...