Struct dbus::tree::Factory [−][src]
pub struct Factory<M: MethodType<D>, D: DataType = ()>(_);
The factory is used to create object paths, interfaces, methods etc.
There are three factories:
MTFn - all methods are Fn()
.
MTFnMut - all methods are FnMut()
. This means they can mutate their environment,
which has the side effect that if you call it recursively, it will RefCell panic.
MTSync - all methods are Fn() + Send + Sync + 'static
. This means that the methods
can be called from different threads in parallel.
Methods
impl Factory<MTFn<()>, ()>
[src]
impl Factory<MTFn<()>, ()>
pub fn new_fn<D: DataType>() -> Factory<MTFn<D>, D>
[src]
pub fn new_fn<D: DataType>() -> Factory<MTFn<D>, D>
Creates a new factory for single-thread use.
pub fn new_fnmut<D: DataType>() -> Factory<MTFnMut<D>, D>
[src]
pub fn new_fnmut<D: DataType>() -> Factory<MTFnMut<D>, D>
Creates a new factory for single-thread use, where callbacks can mutate their environment.
pub fn new_sync<D: DataType>() -> Factory<MTSync<D>, D>
[src]
pub fn new_sync<D: DataType>() -> Factory<MTSync<D>, D>
Creates a new factory for multi-thread use.
impl<D: DataType> Factory<MTFn<D>, D>
[src]
impl<D: DataType> Factory<MTFn<D>, D>
pub fn method<H, T>(
&self,
t: T,
data: D::Method,
handler: H
) -> Method<MTFn<D>, D> where
H: 'static + Fn(&MethodInfo<MTFn<D>, D>) -> MethodResult,
T: Into<Member<'static>>,
[src]
pub fn method<H, T>(
&self,
t: T,
data: D::Method,
handler: H
) -> Method<MTFn<D>, D> where
H: 'static + Fn(&MethodInfo<MTFn<D>, D>) -> MethodResult,
T: Into<Member<'static>>,
Creates a new method for single-thread use.
impl<D: DataType> Factory<MTFnMut<D>, D>
[src]
impl<D: DataType> Factory<MTFnMut<D>, D>
pub fn method<H, T>(
&self,
t: T,
data: D::Method,
handler: H
) -> Method<MTFnMut<D>, D> where
H: 'static + FnMut(&MethodInfo<MTFnMut<D>, D>) -> MethodResult,
T: Into<Member<'static>>,
[src]
pub fn method<H, T>(
&self,
t: T,
data: D::Method,
handler: H
) -> Method<MTFnMut<D>, D> where
H: 'static + FnMut(&MethodInfo<MTFnMut<D>, D>) -> MethodResult,
T: Into<Member<'static>>,
Creates a new method for single-thread use.
impl<D: DataType> Factory<MTSync<D>, D>
[src]
impl<D: DataType> Factory<MTSync<D>, D>
pub fn method<H, T>(
&self,
t: T,
data: D::Method,
handler: H
) -> Method<MTSync<D>, D> where
H: Fn(&MethodInfo<MTSync<D>, D>) -> MethodResult + Send + Sync + 'static,
T: Into<Member<'static>>,
[src]
pub fn method<H, T>(
&self,
t: T,
data: D::Method,
handler: H
) -> Method<MTSync<D>, D> where
H: Fn(&MethodInfo<MTSync<D>, D>) -> MethodResult + Send + Sync + 'static,
T: Into<Member<'static>>,
Creates a new method for multi-thread use.
impl<M: MethodType<D>, D: DataType> Factory<M, D>
[src]
impl<M: MethodType<D>, D: DataType> Factory<M, D>
pub fn property<A: Arg, T: Into<String>>(
&self,
name: T,
data: D::Property
) -> Property<M, D>
[src]
pub fn property<A: Arg, T: Into<String>>(
&self,
name: T,
data: D::Property
) -> Property<M, D>
Creates a new property.
A
is used to calculate the type signature of the property.
pub fn signal<T: Into<Member<'static>>>(
&self,
name: T,
data: D::Signal
) -> Signal<D>
[src]
pub fn signal<T: Into<Member<'static>>>(
&self,
name: T,
data: D::Signal
) -> Signal<D>
Creates a new signal.
pub fn interface<T: Into<IfaceName<'static>>>(
&self,
name: T,
data: D::Interface
) -> Interface<M, D>
[src]
pub fn interface<T: Into<IfaceName<'static>>>(
&self,
name: T,
data: D::Interface
) -> Interface<M, D>
Creates a new interface.
pub fn object_path<T: Into<Path<'static>>>(
&self,
name: T,
data: D::ObjectPath
) -> ObjectPath<M, D>
[src]
pub fn object_path<T: Into<Path<'static>>>(
&self,
name: T,
data: D::ObjectPath
) -> ObjectPath<M, D>
Creates a new object path.
pub fn tree(&self, data: D::Tree) -> Tree<M, D>
[src]
pub fn tree(&self, data: D::Tree) -> Tree<M, D>
Creates a new tree.
pub fn method_sync<H, T>(
&self,
t: T,
data: D::Method,
handler: H
) -> Method<M, D> where
H: Fn(&MethodInfo<M, D>) -> MethodResult + Send + Sync + 'static,
T: Into<Member<'static>>,
[src]
pub fn method_sync<H, T>(
&self,
t: T,
data: D::Method,
handler: H
) -> Method<M, D> where
H: Fn(&MethodInfo<M, D>) -> MethodResult + Send + Sync + 'static,
T: Into<Member<'static>>,
Creates a new method - usually you'll use "method" instead.
This is useful for being able to create methods in code which is generic over methodtype.
Trait Implementations
impl<M: Debug + MethodType<D>, D: Debug + DataType> Debug for Factory<M, D>
[src]
impl<M: Debug + MethodType<D>, D: Debug + DataType> Debug for Factory<M, D>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<M: Clone + MethodType<D>, D: Clone + DataType> Clone for Factory<M, D>
[src]
impl<M: Clone + MethodType<D>, D: Clone + DataType> Clone for Factory<M, D>
fn clone(&self) -> Factory<M, D>
[src]
fn clone(&self) -> Factory<M, D>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<M: MethodType<D>, D: DataType> From<Arc<IfaceCache<M, D>>> for Factory<M, D>
[src]
impl<M: MethodType<D>, D: DataType> From<Arc<IfaceCache<M, D>>> for Factory<M, D>
Auto Trait Implementations
impl<M, D> Send for Factory<M, D> where
<M as MethodType<D>>::GetProp: Send + Sync,
<D as DataType>::Interface: Send + Sync,
<D as DataType>::Method: Send + Sync,
<M as MethodType<D>>::Method: Send + Sync,
<D as DataType>::Property: Send + Sync,
<M as MethodType<D>>::SetProp: Send + Sync,
<D as DataType>::Signal: Send + Sync,
impl<M, D> Send for Factory<M, D> where
<M as MethodType<D>>::GetProp: Send + Sync,
<D as DataType>::Interface: Send + Sync,
<D as DataType>::Method: Send + Sync,
<M as MethodType<D>>::Method: Send + Sync,
<D as DataType>::Property: Send + Sync,
<M as MethodType<D>>::SetProp: Send + Sync,
<D as DataType>::Signal: Send + Sync,
impl<M, D> Sync for Factory<M, D> where
<M as MethodType<D>>::GetProp: Send + Sync,
<D as DataType>::Interface: Send + Sync,
<D as DataType>::Method: Send + Sync,
<M as MethodType<D>>::Method: Send + Sync,
<D as DataType>::Property: Send + Sync,
<M as MethodType<D>>::SetProp: Send + Sync,
<D as DataType>::Signal: Send + Sync,
impl<M, D> Sync for Factory<M, D> where
<M as MethodType<D>>::GetProp: Send + Sync,
<D as DataType>::Interface: Send + Sync,
<D as DataType>::Method: Send + Sync,
<M as MethodType<D>>::Method: Send + Sync,
<D as DataType>::Property: Send + Sync,
<M as MethodType<D>>::SetProp: Send + Sync,
<D as DataType>::Signal: Send + Sync,