pub trait Strategy {
// Required methods
fn process(&mut self, input: &[u8]) -> Result<Vec<Output>, General>;
fn terminate(&mut self) -> Result<Vec<Output>, General>;
}
Required Methods§
Sourcefn process(&mut self, input: &[u8]) -> Result<Vec<Output>, General>
fn process(&mut self, input: &[u8]) -> Result<Vec<Output>, General>
Processes input data
§Arguments
input
- input data
§Returns
- `Ok(_) processing passed
Err(_)
- error occured during processing
§Errors
If parsing logic finds that JSON is not valid,
it returns error::General
.
Note that streamson assumes that its input is a valid JSONs and if not, it still might be processed without an error. This is caused because streamson does not validate JSON.