From 8493506cf86ac1faec888c0e0f87471e857c15d1 Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 19 May 2021 20:16:09 +0100 Subject: [PATCH] Object skel --- src/lib.rs | 3 +++ src/object.rs | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5e0ae84..643d2eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,9 +3,12 @@ mod ext; use ext::*; +// Internal modules mod object; mod formats; +// TODO: External modules/functions/types/whatever + #[cfg(test)] mod tests { #[test] diff --git a/src/object.rs b/src/object.rs index bfe96e1..642bf64 100644 --- a/src/object.rs +++ b/src/object.rs @@ -1,4 +1,5 @@ use super::*; +use std::io; use smallbox::{ SmallBox, space, @@ -7,9 +8,10 @@ use smallbox::{ type OwnedObjectStackSize = space::S4; -/// An object that can be expose serialise+deserialise methods -pub trait Object{ - // TODO +/// An object that can be expose serialise+deserialise methods polymorphically. +pub trait Object { + fn to_writer(&self, to: &mut dyn io::Write) -> io::Result; + fn from_reader(&mut self, from: &mut dyn io::Read) -> io::Result; //ugh, this SUUUCKS... } /// A polymorphic `Object` that is owned.