Struct dbus_crossroads::PropBuilder [−][src]
pub struct PropBuilder<'a, T: 'static, A: 'static> { /* fields omitted */ }
Expand description
Struct used to describe a property when building an interface.
Implementations
pub fn get<CB>(self, cb: CB) -> Self where
CB: FnMut(&mut PropContext, &mut T) -> Result<A, MethodErr> + Send + 'static,
pub fn get_with_cr<CB>(self, cb: CB) -> Self where
CB: FnMut(&mut PropContext, &mut Crossroads) -> Result<A, MethodErr> + Send + 'static,
pub fn get_with_cr_async<R, CB>(self, cb: CB) -> Self where
CB: FnMut(PropContext, &mut Crossroads) -> R + Send + 'static,
R: Future<Output = PhantomData<A>> + Send + 'static,
pub fn get_async<R, CB>(self, cb: CB) -> Self where
CB: FnMut(PropContext, &mut T) -> R + Send + 'static,
R: Future<Output = PhantomData<A>> + Send + 'static,
Returns a function which, when called, creates a PropertiesChanged message.
Call the resulting function with the path that the object belongs to, and a reference to the new value. If a PropertiesChanged message should be sent (this depends on the emits_changed function called), such a message will be returned.
Panics
If emits_changed is set to “const”, the function will panic.
Adds a set property handler to this property.
In case an EmitsChangedSignal should be emitted, the callback should return Ok(Some(v)) where v is the value to be emitted. If no EmitsChangedSignal should be emitted, return Ok(None).
pub fn set_with_cr<CB>(self, cb: CB) -> Self where
CB: FnMut(&mut PropContext, &mut Crossroads, A) -> Result<Option<A>, MethodErr> + Send + 'static,
pub fn set_with_cr<CB>(self, cb: CB) -> Self where
CB: FnMut(&mut PropContext, &mut Crossroads, A) -> Result<Option<A>, MethodErr> + Send + 'static,
Adds a set property handler to this property, and allowing the entire tree to be changed.
In case an EmitsChangedSignal should be emitted, the callback should return Ok(Some(v)) where v is the value to be emitted. If no EmitsChangedSignal should be emitted, return Ok(None).
pub fn set_custom<CB>(self, cb: CB) -> Self where
CB: FnMut(PropContext, &mut Crossroads, A) -> Option<PropContext> + Send + 'static,
pub fn set_with_cr_async<CB, R>(self, cb: CB) -> Self where
CB: FnMut(PropContext, &mut Crossroads, A) -> R + Send + 'static,
R: Future<Output = PhantomData<Option<A>>> + Send + 'static,
pub fn set_async<CB, R>(self, cb: CB) -> Self where
CB: FnMut(PropContext, &mut T, A) -> R + Send + 'static,
R: Future<Output = PhantomData<Option<A>>> + Send + 'static,
This means that the property never changes. Attempts to change it or make an “PropertiesChanged” signal will result in a panic.