Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6590bd00 authored by Sonny Sasaka's avatar Sonny Sasaka
Browse files

floss: Convert DBus method returns from rust type

This adds support to use Rust data types for D-Bus method returns. Just
like D-Bus method parameters, the Rust data type needs to implement
DBusArg.

Bug: 189497374
Tag: #floss
Test: Build on Linux

Change-Id: Ib84dafc34027feeb2a791d09f02f28d4911de00c
parent 398a7116
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -142,8 +142,8 @@ pub fn generate_dbus_exporter(attr: TokenStream, item: TokenStream) -> TokenStre
            let mut output_type = quote! {};
            let mut ret = quote! {Ok(())};
            if let ReturnType::Type(_, t) = method.sig.output {
                output_type = quote! {#t,};
                ret = quote! {Ok((ret,))};
                output_type = quote! {<#t as DBusArg>::DBusType,};
                ret = quote! {Ok((<#t as DBusArg>::to_dbus(ret).unwrap(),))};
                output_names = quote! { "out", };
            }