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 has been archived by the owner on May 11, 2023. It is now read-only.
error[E0277]: the trait bound `std::option::Option<std::string::String>: From<zbus::zvariant::Value<'_>>` is not satisfied
--> src/main.rs:44:67
|
44 | #[derive(Debug, Clone, PartialEq, Default, Type, DeserializeDict, Value)]
| ^^^^^ the trait `From<zbus::zvariant::Value<'_>>` is not implemented for `std::option::Option<std::string::String>`
|
= help: the following other types implement trait `From<T>`:
<std::option::Option<&'a T> as From<&'a std::option::Option<T>>>
<std::option::Option<&'a mut T> as From<&'a mut std::option::Option<T>>>
<std::option::Option<&'a tracing_core::span::Id> as From<&'a tracing::span::EnteredSpan>>
<std::option::Option<&'a tracing_core::span::Id> as From<&'a tracing::span::Span>>
<std::option::Option<&'a tracing_core::span::Id> as From<&'a tracing_core::span::Current>>
<std::option::Option<&'static tracing_core::metadata::Metadata<'static>> as From<&'a tracing_core::span::Current>>
<std::option::Option<T> as From<Optional<T>>>
<std::option::Option<T> as From<T>>
and 7 others
= note: required because of the requirements on the impl of `Into<std::option::Option<std::string::String>>` for `zbus::zvariant::Value<'_>`
= note: required because of the requirements on the impl of `TryFrom<zbus::zvariant::Value<'_>>` for `std::option::Option<std::string::String>`
note: required by a bound in `zbus::zvariant::Value::<'a>::downcast`
--> /home/sw/.cargo/registry/src/github.com-1ecc6299db9ec823/zvariant-3.10.0/src/value.rs:310:12
|
310 | T: TryFrom<Value<'a>>,
| ^^^^^^^^^^^^^^^^^^ required by this bound in `zbus::zvariant::Value::<'a>::downcast`
= note: this error originates in the derive macro `Value` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0277`.
The text was updated successfully, but these errors were encountered:
Workaround for Dict structs that need to derive Value for use in property getters is to not derive Value, and implement a custom TryFromzvariant::Value.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In GitLab by @seiwill on Feb 1, 2023, 17:41
Deriving
Value
onsignature = dict
Struct
s that haveOption
values fails to compile.Gives error:
The text was updated successfully, but these errors were encountered: