i fucking suck at everything

master
Avril 4 years ago
parent 25a0f7b502
commit 070f9bbb7e
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -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