DeserializeDict: Unexpected non-0 padding byte `1`
There is an issue with the new Dict derive macros:
use std::error::Error;
use std::convert::TryInto;
use std::collections::HashMap;
use zbus::{dbus_interface, fdo};
use zvariant::OwnedValue;
use zvariant_derive::{SerializeDict, DeserializeDict, TypeDict};
#[derive(SerializeDict, DeserializeDict, TypeDict, Debug)]
struct Foo {
logical_id: i32,
online: bool,
opt: Option<bool>,
}
struct Greeter;
#[dbus_interface(name = "org.zbus.MyGreeter1")]
impl Greeter {
fn test_dict(&self, arg: Vec<HashMap<&str, OwnedValue>>) {
dbg!(arg);
}
fn test_struct(&self, arg: Vec<Foo>) {
dbg!(arg);
}
}
fn main() -> Result<(), Box<dyn Error>> {
let connection = zbus::Connection::new_session()?;
fdo::DBusProxy::new(&connection)?.request_name(
"org.zbus.MyGreeter",
fdo::RequestNameFlags::ReplaceExisting.into(),
)?;
let mut object_server = zbus::ObjectServer::new(&connection);
object_server.at(&"/org/zbus/MyGreeter".try_into()?, Greeter)?;
loop {
if let Err(err) = object_server.try_handle_next() {
eprintln!("{}", err);
}
}
}
busctl --user call org.zbus.MyGreeter /org/zbus/MyGreeter org.zbus.MyGreeter1 TestStruct a\{sv\} 2 logical-id i 0 online b 1
Call failed: Unexpected non-0 padding byte `1`