pub struct SignalProp<A> {
    data: A,
    msgfn: Arc<dyn Fn(&Path<'_>, &dyn RefArg) -> Option<Message> + Send + Sync>,
    dbuspath: Arc<SensorPath>,
    conn: Arc<SyncConnection>,
}
Expand description

A dbus property that owns its own data and automatically sends property-change signals on updates.

Fields

data: A

The current value of the property.

msgfn: Arc<dyn Fn(&Path<'_>, &dyn RefArg) -> Option<Message> + Send + Sync>

A function to create a PropetiesChanged signal message when data changes.

dbuspath: Arc<SensorPath>

The dbus path of the object this property belongs to.

conn: Arc<SyncConnection>

The dbus connection via which PropetiesChanged signals are sent.

Implementations

Construct a SignalProp with the given members.

Retrieve self’s current value.

Retrieve a clone of self’s current value.

Update self’s value to newdata, emitting a PropertiesChanged signal to dbus if newdata is unequal to self.data’s previous value.

Emit a PropertiesChanged signal to dbus with self’s current value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.