-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
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
Unable to use serde
macros in additional_derives
when importing wasi::http
types
#812
Comments
|
Another related bug I just encountered: When a resource perf-event {
constructor();
parse-string: func(input: string) -> result<some-event, string>;
}
resource constructor-perf-event {
constructor(input: string);
get-data: func() -> some-event;
}
variant supported-events {
none,
my-event(constructor-perf-event),
foo(perf-event)
}
resource variant-perf-event {
constructor(input: supported-events);
get-child-event: func() -> supported-events;
} Due to the error[E0277]: the trait bound `component::events::PerfEvent: Serialize` is not satisfied
--> src/bindings.rs:601:46
|
601 | #[derive(serde::Deserialize, serde::Serialize)]
| ^^^^^^^^^^^^^^^^ the trait `Serialize` is not implemented for `component::events::PerfEvent`
...
605 | Foo(PerfEvent),
| -------------- required by a bound introduced by this call I think this is further evidence to motivate some kind of attribute system in WIT so things like |
This is correct, if I add additional derives, I expect it to only be added to records and not custom resources, or at least a way to specify what resources not to apply to. Is there any solution currently to using serde for types but ignoring for resources/ fixing for resources? |
I have a simple library testing out the
wasi:http
types. When I try to add anadditional_derives: [serde::Serialize, serde::Deserialize]
to thewit_bindgen::generate!
macro definition I get the below error. Not sure if thise repo or thewasi-http
repo would be better for this issue, but trying here first.Reproduction can be found in this repo. Uncommenting this line will cause the error.
The text was updated successfully, but these errors were encountered: