Property changed signal is only generated for properties with setter method
Using zbus v2.0.0-beta.3, the following code doesn't compile unless the set_prop()
method is uncommented.
use zbus::dbus_interface;
struct Smth;
#[dbus_interface(name = "org.example.Smth")]
impl Smth {
#[dbus_interface(property)]
pub fn prop(&self) -> i32 {
unimplemented!()
}
/*
#[dbus_interface(property)]
pub fn set_prop(&mut self, _prop: i32) {
unimplemented!()
}
*/
}
fn main() {
let smth = Smth;
smth.prop_changed().unwrap();
}
With the following error output.
error[E0599]: no method named `prop_changed` found for struct `Smth` in the current scope
--> src/main.rs:22:10
|
3 | struct Smth;
| ------------ method `prop_changed` not found for this
...
22 | smth.prop_changed().unwrap();
| ^^^^^^^^^^^^ method not found in `Smth`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
Edited by Thomas Mühlbacher