-
In the following snippet: use dbus::blocking::Connection;
use std::time::Duration;
fn main() {
let conn = Connection::new_system().unwrap();
let proxy = conn.with_proxy(
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
Duration::from_secs(5),
);
let (res,): (Vec<(u32,)>,) = proxy
.method_call("org.freedesktop.systemd1.Manager", "ListUnits", ())
.unwrap();
dbg!(res);
} where the struct type is actually Why is this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Figured it out: this seems to be a limitation impl<'a, T: Arg + Get<'a>> Get<'a> for Vec<T> {
fn get(i: &mut Iter<'a>) -> Option<Self> {
<Array<T, Iter<'a>>>::get(i).map(|a| a.collect())
}
} As far as I can tell, as long as the return type is an array, this will return |
Beta Was this translation helpful? Give feedback.
-
There seems to be a todo item for exactly this:
PRs welcome. :-) |
Beta Was this translation helpful? Give feedback.
Figured it out: this seems to be a limitation
Vec
's implementation ofGet::get
:As far as I can tell, as long as the return type is an array, this will return
Some
, leading to no error being thrown byIter::read
.