diff --git a/src/processor.rs b/src/processor.rs index 63bf31d..4c3e2ed 100644 --- a/src/processor.rs +++ b/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; + fn read_object(&self, input: &mut dyn io::Read) -> Result; + fn write_object(&self, obj: &Object, output: &mut dyn io::Write) -> Result; } processor!(Json: {