From 070f9bbb7e6e6891cd08966a44fea2315192bac0 Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 19 May 2021 03:00:47 +0100 Subject: [PATCH] i fucking suck at everything --- src/processor.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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: {