Struct dbus::tree::Property [−][src]
pub struct Property<M: MethodType<D>, D: DataType> { /* fields omitted */ }
A D-Bus Property.
Methods
impl<M: MethodType<D>, D: DataType> Property<M, D>
[src]
impl<M: MethodType<D>, D: DataType> Property<M, D>
pub fn emits_changed(self, e: EmitsChangedSignal) -> Self
[src]
pub fn emits_changed(self, e: EmitsChangedSignal) -> Self
Builder method that allows setting the Property's signal behavior when changed.
Note: if e is set to const, the property will be read only.
pub fn auto_emit_on_set(self, b: bool) -> Self
[src]
pub fn auto_emit_on_set(self, b: bool) -> Self
Builder method that determines whether or not setting this property will result in an PropertiesChanged signal. Defaults to true.
When set to true (the default), the behaviour is determined by "emits_changed".
When set to false, no PropertiesChanged signal will be emitted (but the signal
still shows up in introspection data).
You can still emit the signal manually by, e g, calling add_propertieschanged
and send the resulting message(s).
pub fn access(self, e: Access) -> Self
[src]
pub fn access(self, e: Access) -> Self
Builder method that allows setting the Property as readable, writable, or both.
Note: might modify emits_changed as well, if property is changed to non-readonly and emit is set to "Const".
pub fn annotate<N: Into<String>, V: Into<String>>(
self,
name: N,
value: V
) -> Self
[src]
pub fn annotate<N: Into<String>, V: Into<String>>(
self,
name: N,
value: V
) -> Self
Builder method that adds an annotation to the method.
pub fn deprecated(self) -> Self
[src]
pub fn deprecated(self) -> Self
Builder method that adds an annotation that this entity is deprecated.
pub fn get_name(&self) -> &str
[src]
pub fn get_name(&self) -> &str
Get property name
pub fn get_data(&self) -> &D::Property
[src]
pub fn get_data(&self) -> &D::Property
Get associated data
pub fn can_get(&self) -> Result<(), MethodErr>
[src]
pub fn can_get(&self) -> Result<(), MethodErr>
Returns Ok if the property is gettable
pub fn get_as_variant(
&self,
i: &mut IterAppend,
pinfo: &PropInfo<M, D>
) -> Result<(), MethodErr>
[src]
pub fn get_as_variant(
&self,
i: &mut IterAppend,
pinfo: &PropInfo<M, D>
) -> Result<(), MethodErr>
Calls the on_get function and appends the result as a variant.
Note: Will panic if get_cb is not set.
pub fn can_set(&self, i: Option<Iter>) -> Result<(), MethodErr>
[src]
pub fn can_set(&self, i: Option<Iter>) -> Result<(), MethodErr>
Returns Ok if the property is settable.
Will verify signature in case iter is not None; iter is supposed to point at the Variant with the item inside.
pub fn set_as_variant(
&self,
i: &mut Iter,
pinfo: &PropInfo<M, D>
) -> Result<Option<Message>, MethodErr>
[src]
pub fn set_as_variant(
&self,
i: &mut Iter,
pinfo: &PropInfo<M, D>
) -> Result<Option<Message>, MethodErr>
Calls the on_set function, which reads from i.
The return value might contain an extra message containing the EmitsChanged signal. Note: Will panic if set_cb is not set.
pub fn add_propertieschanged<F: FnOnce() -> Box<RefArg>>(
&self,
v: &mut Vec<PropertiesPropertiesChanged>,
iface: &IfaceName,
new_value: F
)
[src]
pub fn add_propertieschanged<F: FnOnce() -> Box<RefArg>>(
&self,
v: &mut Vec<PropertiesPropertiesChanged>,
iface: &IfaceName,
new_value: F
)
Adds this property to a list of PropertiesChanged signals.
"v" is updated with the signal for this property. "new_value" is only called if self.emits is "true", it should return the value of the property. If no PropertiesChanged signal should be emitted for this property, "v" is left unchanged.
impl<'a, D: DataType> Property<MTFn<D>, D>
[src]
impl<'a, D: DataType> Property<MTFn<D>, D>
pub fn on_get<H>(self, handler: H) -> Property<MTFn<D>, D> where
H: 'static + Fn(&mut IterAppend, &PropInfo<MTFn<D>, D>) -> Result<(), MethodErr>,
[src]
pub fn on_get<H>(self, handler: H) -> Property<MTFn<D>, D> where
H: 'static + Fn(&mut IterAppend, &PropInfo<MTFn<D>, D>) -> Result<(), MethodErr>,
Sets the callback for getting a property.
For single-thread use.
pub fn on_set<H>(self, handler: H) -> Property<MTFn<D>, D> where
H: 'static + Fn(&mut Iter, &PropInfo<MTFn<D>, D>) -> Result<(), MethodErr>,
[src]
pub fn on_set<H>(self, handler: H) -> Property<MTFn<D>, D> where
H: 'static + Fn(&mut Iter, &PropInfo<MTFn<D>, D>) -> Result<(), MethodErr>,
Sets the callback for setting a property.
For single-thread use.
impl<'a, D: DataType> Property<MTFnMut<D>, D>
[src]
impl<'a, D: DataType> Property<MTFnMut<D>, D>
pub fn on_get<H>(self, handler: H) -> Property<MTFnMut<D>, D> where
H: 'static + Fn(&mut IterAppend, &PropInfo<MTFnMut<D>, D>) -> Result<(), MethodErr>,
[src]
pub fn on_get<H>(self, handler: H) -> Property<MTFnMut<D>, D> where
H: 'static + Fn(&mut IterAppend, &PropInfo<MTFnMut<D>, D>) -> Result<(), MethodErr>,
Sets the callback for getting a property.
For single-thread use.
pub fn on_set<H>(self, handler: H) -> Property<MTFnMut<D>, D> where
H: 'static + Fn(&mut Iter, &PropInfo<MTFnMut<D>, D>) -> Result<(), MethodErr>,
[src]
pub fn on_set<H>(self, handler: H) -> Property<MTFnMut<D>, D> where
H: 'static + Fn(&mut Iter, &PropInfo<MTFnMut<D>, D>) -> Result<(), MethodErr>,
Sets the callback for setting a property.
For single-thread use.
impl<D: DataType> Property<MTSync<D>, D>
[src]
impl<D: DataType> Property<MTSync<D>, D>
pub fn on_get<H>(self, handler: H) -> Property<MTSync<D>, D> where
H: Fn(&mut IterAppend, &PropInfo<MTSync<D>, D>) -> Result<(), MethodErr> + Send + Sync + 'static,
[src]
pub fn on_get<H>(self, handler: H) -> Property<MTSync<D>, D> where
H: Fn(&mut IterAppend, &PropInfo<MTSync<D>, D>) -> Result<(), MethodErr> + Send + Sync + 'static,
Sets the callback for getting a property.
For multi-thread use.
pub fn on_set<H>(self, handler: H) -> Property<MTSync<D>, D> where
H: Fn(&mut Iter, &PropInfo<MTSync<D>, D>) -> Result<(), MethodErr> + Send + Sync + 'static,
[src]
pub fn on_set<H>(self, handler: H) -> Property<MTSync<D>, D> where
H: Fn(&mut Iter, &PropInfo<MTSync<D>, D>) -> Result<(), MethodErr> + Send + Sync + 'static,
Sets the callback for setting a property.
For single-thread use.
impl<M: MethodType<D>, D: DataType> Property<M, D> where
D::Property: Append + Clone,
[src]
impl<M: MethodType<D>, D: DataType> Property<M, D> where
D::Property: Append + Clone,
pub fn default_get(self) -> Self
[src]
pub fn default_get(self) -> Self
Adds a "standard" get handler.
impl<M: MethodType<D>, D: DataType> Property<M, D> where
D::Property: RefArg,
[src]
impl<M: MethodType<D>, D: DataType> Property<M, D> where
D::Property: RefArg,
pub fn default_get_refarg(self) -> Self
[src]
pub fn default_get_refarg(self) -> Self
Adds a "standard" get handler (for RefArgs).
Trait Implementations
impl<M: Debug + MethodType<D>, D: Debug + DataType> Debug for Property<M, D> where
D::Property: Debug,
[src]
impl<M: Debug + MethodType<D>, D: Debug + DataType> Debug for Property<M, D> where
D::Property: Debug,