Struct dbus_tree::Tree [−][src]
pub struct Tree<M: MethodType<D>, D: DataType> { /* fields omitted */ }
Expand description
A collection of object paths.
Implementations
Builder function that adds an object path to this tree.
Get a reference to an object path from the tree.
Iterates over object paths in this tree.
Non-builder function that adds an object path to this tree.
Remove a object path from the Tree. Returns the object path removed, or None if not found.
Registers or unregisters all object paths in the tree to a ffidisp::Connection.
pub fn run<'a, I: Iterator<Item = ConnectionItem>>(
&'a self,
c: &'a Connection,
i: I
) -> TreeServer<'a, I, M, D>ⓘNotable traits for TreeServer<'a, I, M, D>impl<'a, I: Iterator<Item = ConnectionItem>, M: 'a + MethodType<D>, D: DataType + 'a> Iterator for TreeServer<'a, I, M, D> type Item = ConnectionItem;
pub fn run<'a, I: Iterator<Item = ConnectionItem>>(
&'a self,
c: &'a Connection,
i: I
) -> TreeServer<'a, I, M, D>ⓘNotable traits for TreeServer<'a, I, M, D>impl<'a, I: Iterator<Item = ConnectionItem>, M: 'a + MethodType<D>, D: DataType + 'a> Iterator for TreeServer<'a, I, M, D> type Item = ConnectionItem;
impl<'a, I: Iterator<Item = ConnectionItem>, M: 'a + MethodType<D>, D: DataType + 'a> Iterator for TreeServer<'a, I, M, D> type Item = ConnectionItem;
This method takes an ConnectionItem
iterator (you get it from Connection::iter()
)
and handles all matching items. Non-matching items (e g signals) are passed through.
Handles a message.
Will return None in case the object path was not found in this tree, or otherwise a list of messages to be sent back.
Tries to handle an incoming message from the provided channel if there is one. If there isn’t one, it will wait up to timeout
pub fn start_receive_sync<C>(self, connection: &C) where
C: MatchingReceiver<F = Box<dyn FnMut(Message, &C) -> bool + Send + Sync>> + Sender,
D::Tree: Send + Sync,
D::ObjectPath: Send + Sync,
D::Interface: Send + Sync,
D::Property: Send + Sync,
D::Method: Send + Sync,
D::Signal: Send + Sync,
M::Method: Send + Sync,
M::GetProp: Send + Sync,
M::SetProp: Send + Sync,
pub fn start_receive_sync<C>(self, connection: &C) where
C: MatchingReceiver<F = Box<dyn FnMut(Message, &C) -> bool + Send + Sync>> + Sender,
D::Tree: Send + Sync,
D::ObjectPath: Send + Sync,
D::Interface: Send + Sync,
D::Property: Send + Sync,
D::Method: Send + Sync,
D::Signal: Send + Sync,
M::Method: Send + Sync,
M::GetProp: Send + Sync,
M::SetProp: Send + Sync,
Connects a SyncConnection with a Tree so that incoming method calls are handled.
The tree needs to be of type MTSync.
pub fn start_receive_send<C>(self, connection: &C) where
C: MatchingReceiver<F = Box<dyn FnMut(Message, &C) -> bool + Send>> + Sender,
D::Tree: Send + Sync,
D::ObjectPath: Send + Sync,
D::Interface: Send + Sync,
D::Property: Send + Sync,
D::Method: Send + Sync,
D::Signal: Send + Sync,
M::Method: Send + Sync,
M::GetProp: Send + Sync,
M::SetProp: Send + Sync,
pub fn start_receive_send<C>(self, connection: &C) where
C: MatchingReceiver<F = Box<dyn FnMut(Message, &C) -> bool + Send>> + Sender,
D::Tree: Send + Sync,
D::ObjectPath: Send + Sync,
D::Interface: Send + Sync,
D::Property: Send + Sync,
D::Method: Send + Sync,
D::Signal: Send + Sync,
M::Method: Send + Sync,
M::GetProp: Send + Sync,
M::SetProp: Send + Sync,
Connects a Connection with a Tree so that incoming method calls are handled.
The tree needs to be of type MTSync.
pub fn start_receive<C>(self, connection: &C) where
C: MatchingReceiver<F = Box<dyn FnMut(Message, &C) -> bool>> + Sender,
pub fn start_receive<C>(self, connection: &C) where
C: MatchingReceiver<F = Box<dyn FnMut(Message, &C) -> bool>> + Sender,
Connects a LocalConnection with a Tree so that incoming method calls are handled.
Trait Implementations
Function to be called if the message matches the MsgHandlerType
Type of messages for which the handler will be called Read more