We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enum
What would be the right way of marshalling a Rust enum like this one?
pub enum Fruit { Apple, Orange, Banana }
Does it depend on the enum having fmt::Display implemented?
fmt::Display
The text was updated successfully, but these errors were encountered:
I would use the borsh crate to derive BorshSerialize
borsh
BorshSerialize
#[derive(BorshSerialize)] pub enum Fruit { .. }
at which point the ToHaskell<YourApp> instance is trivial:
ToHaskell<YourApp>
impl ToHaskell<YourApp> for Fruit { fn to_haskell<W: Write>(&self, writer: &mut W, _tag: PhantomData<YourApp>) -> Result<()> { self.serialize(writer)?; Ok(()) } }
Sorry, something went wrong.
No branches or pull requests
What would be the right way of marshalling a Rust
enum
like this one?Does it depend on the
enum
havingfmt::Display
implemented?The text was updated successfully, but these errors were encountered: