Skip to content
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

Deserialize<'_> is not implemented for xdg::ServerInformation #221

Open
matthiasbeyer opened this issue Jul 21, 2024 · 2 comments
Open

Deserialize<'_> is not implemented for xdg::ServerInformation #221

matthiasbeyer opened this issue Jul 21, 2024 · 2 comments
Milestone

Comments

@matthiasbeyer
Copy link

.deserialize()?;

This line makes the compiler unhappy if I use notify-rust with default-features = false, features = ["zbus"].

You may want to check the feature gates on this particular code piece 😉


Full error:

    Checking notify-rust v4.11.0
error[E0277]: the trait bound `xdg::ServerInformation: DynamicDeserialize<'_>` is not satisfied
   --> /home/m/.cargo/registry/src/index.crates.io-6f17d22bba15001f/notify-rust-4.11.0/src/xdg/zbus_rs.rs:217:10
    |
217 |         .deserialize()?;
    |          ^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `xdg::ServerInformation`, which is required by `xdg::ServerInformation: DynamicDeserialize<'_>`
    |
    = help: the following other types implement trait `DynamicDeserialize<'de>`:
              <DynamicTuple<(T0, T1)> as DynamicDeserialize<'de>>
              <DynamicTuple<(T0, T1, T2)> as DynamicDeserialize<'de>>
              <DynamicTuple<(T0, T1, T2, T3)> as DynamicDeserialize<'de>>
              <DynamicTuple<(T0, T1, T2, T3, T4)> as DynamicDeserialize<'de>>
              <DynamicTuple<(T0, T1, T2, T3, T4, T5)> as DynamicDeserialize<'de>>
              <DynamicTuple<(T0, T1, T2, T3, T4, T5, T6)> as DynamicDeserialize<'de>>
              <DynamicTuple<(T0, T1, T2, T3, T4, T5, T6, T7)> as DynamicDeserialize<'de>>
              <DynamicTuple<(T0, T1, T2, T3, T4, T5, T6, T7, T8)> as DynamicDeserialize<'de>>
            and 11 others
    = note: required for `xdg::ServerInformation` to implement `DynamicDeserialize<'_>`
note: required by a bound in `Body::deserialize`
   --> /home/m/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zbus-4.3.1/src/message/body.rs:25:12
    |
23  |     pub fn deserialize<'s, B>(&'s self) -> Result<B>
    |            ----------- required by a bound in this associated function
24  |     where
25  |         B: zvariant::DynamicDeserialize<'s>,
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Body::deserialize`


@hoodie
Copy link
Owner

hoodie commented Jul 21, 2024

Thanks for letting me know, I was a bit confused how this was possible until I looked at the combination of things.
The feature flag for using zbus is "z" not "zbus". I think I could technically just change that. Or document that better. Not sure. Any suggestion?

@matthiasbeyer
Copy link
Author

Well for me it was unclear that z is the feature flag I need. You could add a compiler error if a user only enables zbus but not serde, but I am not sure whether this is actually an error... can the crate work without serde when `zbus is used? If not, why have it as seperate features?

@hoodie hoodie added this to the v5.0.0 milestone Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants