I'm trying to get 'Interfaces' property use dbus-rs crate, but it always complains "implementation of Get
is not general enough", here is the code:
use dbus::arg::Array;
use dbus::blocking::stdintf::org_freedesktop_dbus::Properties;
use dbus::blocking::Connection;
use std::time::Duration;
fn main() {
let dbus = Connection::new_system().unwrap();
let proxy = dbus.with_proxy(
"fi.w1.wpa_supplicant1",
"/fi/w1/wpa_supplicant1",
Duration::from_secs(1),
);
let interfaces: Result<Array<u16, _>, _> =
proxy.get("fi.w1.wpa_supplicant1", "Interfaces");
println!("{:?}", interfaces);
}
and the compile error messages:
Checking dbus_learn v0.1.0
error: implementation of `Get` is not general enough
--> src/main.rs:16:9
|
16 | proxy.get("fi.w1.wpa_supplicant1", "Interfaces");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Get` is not general enough
|
= note: `Get<'0>` would have to be implemented for the type `dbus::arg::Array<'_, u16, dbus::arg::Iter<'_>>`, for any lifetime `'0`...
= note: ...but `Get<'1>` is actually implemented for the type `dbus::arg::Array<'1, u16, dbus::arg::Iter<'1>>`, for some specific lifetime `'1`
error: could not compile `dbus_learn` (bin "dbus_learn") due to 1 previous error
I don't understand what's the difference of "Get<'0>" with "Get<'1>", the two seems have the same type.