Open khazaddum opened 1 year ago
I would use the borsh
crate to derive BorshSerialize
#[derive(BorshSerialize)]
pub enum Fruit { .. }
at which point the ToHaskell<YourApp>
instance is trivial:
impl ToHaskell<YourApp> for Fruit {
fn to_haskell<W: Write>(&self, writer: &mut W, _tag: PhantomData<YourApp>) -> Result<()> {
self.serialize(writer)?;
Ok(())
}
}
What would be the right way of marshalling a Rust
enum
like this one?Does it depend on the
enum
havingfmt::Display
implemented?