Multiple out arguments as a struct — missing feature / misleading docs
Reading https://docs.rs/zbus/1.8.0/zbus/attr.dbus_interface.html :
struct_return
- the method returns a structure. Although it is very rare for a D-Bus method to return a single structure, it does happen. Since it is not possible for zbus to differentiate this case from multiple out arguments put in a structure, you must either explicitly mark the case of single structure return with this attribute or wrap the structure in another structure or tuple. The latter can be achieve by using (,) syntax, for example instead of MyStruct, write (MyStruct,)
This seems to imply that you can have "multiple out arguments put in a structure", but this doesn't seem to be actually supported. e.g. if I return this struct
#[derive(serde::Serialize, zvariant::derive::Type)]
struct CreatedSession {
session_id: String,
object_path: zvariant::ObjectPath<'static>,
runtime_path: String,
fifo_fd: zvariant::Fd,
}
It shows up in introspection as
out (sosh) arg_13);
Here, looks like only actual Rust tuples would ever have multiple introspect_add_output_arg
calls, any other type is treated as one arg: