You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
Hey all, starting playing around with this, looks very cool.
Ran into the problem in the title almost right away though, which was rather surprising. I assume just an oversight, but would be nice to have.
Additionally when I first tried writing a generic Serializable struct, I added bounds to the generic for T: Serializable which I would expect to be necessary, but the macro seems to break on that (and if you remove it, appears to silently enforce it). It'd be good to allow that, or have a more explicit error.
@Sushisource thanks for sharing. I'm currently doing some work to allow unit types to be used in return types (e.g. Result<(), Error>). Do you have a use case for having unit fields in a struct? Otherwise I'm not sure we'd want to support that.
use fp_bindgen::prelude::*;#[derive(Serializable)]structFoo<T>{hi:T}
Where some reification of that struct might reasonably want to use the unit type because it happens not to care about populating that field meaningfully
Activity
[-]`()` not `Serializeable`[/-][+]`()` not `Serializable`[/+]emschwartz commentedon Apr 1, 2022
Based on @arendjr adding the
good first issuelabel, I think he's saying that yes this is indeed an oversight :) Thanks for reporting the issue!sagacity commentedon Jul 4, 2022
I'll pick this up.
sagacity commentedon Jul 4, 2022
@Sushisource could you share the struct definition that wasn't working for you?
Sushisource commentedon Jul 5, 2022
Even just this will do it:
Results in:
sagacity commentedon Jul 6, 2022
@Sushisource thanks for sharing. I'm currently doing some work to allow unit types to be used in return types (e.g.
Result<(), Error>). Do you have a use case for having unit fields in a struct? Otherwise I'm not sure we'd want to support that.Sushisource commentedon Jul 6, 2022
Yeah, the use case is a generic struct like this:
Where some reification of that struct might reasonably want to use the unit type because it happens not to care about populating that field meaningfully