Open ids1024 opened 3 years ago
You could also go with Option<Box<dyn Fn(...) -> ...>>
for starters but that's less nice to use of course.
that's less nice to use of course
And inconsistent with other gtk-rs APIs.
I wish the never type was available and implemented function traits so None::<!>
could magically work (maybe it will at some point). But a builder pattern probably looks cleaner when passing multiple closures anyway.
https://docs.gtk.org/gio/method.DBusConnection.register_object_with_closures.html documents these arguments as nullable, and https://docs.gtk.org/gio/struct.DBusInterfaceVTable.html mentions:
So presumably this function should be usable with
None
forget_property
/set_property
to be able to cover this use case.Given
None
isn't practical for generic function types, changing the function to use the builder pattern would probably make sense.