Browse Source

i fucking suck at everything

master
Avril 6 months ago
parent
commit
070f9bbb7e
Signed by: flanchan GPG Key ID: 284488987C31F630
  1. 7
      src/processor.rs

7
src/processor.rs

@ -14,10 +14,15 @@ macro_rules! processor {
};
}
//TODO: Move this to `object.rs`. Have a type that polymorphises any `Serialize` object, somehow...
//This may be impossible. If it is. Nuke this file, and re-do the `FORMATS` table's value type to `fn(...SOMETHING...) -> io::Result<...SOMETHING...>`
pub type Object = ();
pub trait Processor
{
//TODO: How to design this trait??? eh...
fn process_stream(&self, input: &mut dyn serde::Serialize, output: &mut dyn io::Write) -> Result<usize, Error>;
fn read_object(&self, input: &mut dyn io::Read) -> Result<Object, Error>;
fn write_object(&self, obj: &Object, output: &mut dyn io::Write) -> Result<usize, Error>;
}
processor!(Json: {

Loading…
Cancel
Save