[−][src]Struct dbus_async::DBus
This struct represents an object to communicate with the DBus daemon.
Implementations
impl DBus
[src]
pub async fn session(introspectable: bool) -> DBusResult<(DBus, JoinHandle<()>)>
[src]
Connect to the session DBus.
If the first argument (introspectable
) is true
then the Peer is introspectable.
The DBUS_SESSION_BUS_ADDRESS
environment variable have to be defined.
pub async fn system(introspectable: bool) -> DBusResult<(DBus, JoinHandle<()>)>
[src]
Connect to the system DBus.
If the first argument (introspectable
) is true
then the Peer is introspectable.
If there DBUS_SYSTEM_BUS_ADDRESS
environment variable is defined then this path will be
used, else unix:path=/var/run/dbus/system_bus_socket
.
pub async fn new<'_>(
addressses: &'_ str,
introspectable: bool
) -> DBusResult<(DBus, JoinHandle<()>)>
[src]
addressses: &'_ str,
introspectable: bool
) -> DBusResult<(DBus, JoinHandle<()>)>
Connect to the specific (addressses
) DBus daemon.
If the second argument (introspectable
) is true
then the Peer is introspectable.
pub fn send(&self, msg: Message) -> DBusResult<()>
[src]
Send a Message
.
pub async fn call<'_>(&'_ self, msg: Message) -> DBusResult<Message>
[src]
pub async fn call_reply_serial<'_>(
&'_ self,
msg: Message,
msg_sender: MpscSender<Message>
) -> DBusResult<u32>
[src]
&'_ self,
msg: Message,
msg_sender: MpscSender<Message>
) -> DBusResult<u32>
Send a Message
and specify a channel, where the response should be send.
This function returns the serial number of the Message
. This is useful, where the the
response and signals have to be processed in order.
pub async fn register_name<'_, '_>(
&'_ self,
name: String,
flags: &'_ DBusNameFlag
) -> DBusResult<Message>
[src]
&'_ self,
name: String,
flags: &'_ DBusNameFlag
) -> DBusResult<Message>
Register a name for the peer. This calls the RequestName(String, UInt32)
method of the
DBus daemon.
pub fn add_method_call(
&self,
object_path: ObjectPath,
sender: MpscSender<Message>
) -> DBusResult<()>
[src]
&self,
object_path: ObjectPath,
sender: MpscSender<Message>
) -> DBusResult<()>
Add a channel to a specific ObjectPath
.
The channel will receive all MethodCall
messages for the specified ObjectPath
.
If there is already channel added for this ObjectPath
then it will be replace. So the
old channel will not receive any MethodCall
messages for the ObjectPath
anymore.
pub fn delete_object_path(&self, object_path: ObjectPath) -> DBusResult<()>
[src]
Delete the channel for a specific ObjectPath
(see add_method_call
).
Even if there is no channel for this ObjectPath
the function will return Ok()
.
pub fn delete_method_call_sender(
&self,
sender: MpscSender<Message>
) -> DBusResult<()>
[src]
&self,
sender: MpscSender<Message>
) -> DBusResult<()>
Delete the channel for every ObjectPath
, which the given sender is connected to
(see add_method_call
).
pub fn delete_method_call_receiver(
&self,
receiver: MpscReceiver<Message>
) -> DBusResult<()>
[src]
&self,
receiver: MpscReceiver<Message>
) -> DBusResult<()>
Delete the channel for every ObjectPath
, which the given sender is connected to
(see add_method_call
).
pub fn add_method_call_interface(
&self,
interface: Interface,
sender: MpscSender<Message>
) -> DBusResult<()>
[src]
&self,
interface: Interface,
sender: MpscSender<Message>
) -> DBusResult<()>
Add a channel to a specific Interface
.
The channel will only receive all MethodCall
messages for the specified Interface
,
if there is no channel by the ObjectPath
.
If there is already channel added for this Interface
then it will be replace. So the old
channel will not receive any MethodCall
messages for the Interface
anymore.
pub fn delete_method_call_interface_sender(
&self,
sender: MpscSender<Message>
) -> DBusResult<()>
[src]
&self,
sender: MpscSender<Message>
) -> DBusResult<()>
Delete the channel for every Interface
, which the given sender is connected to
(see add_method_call_interface
).
pub fn delete_method_call_interface_receiver(
&self,
receiver: MpscReceiver<Message>
) -> DBusResult<()>
[src]
&self,
receiver: MpscReceiver<Message>
) -> DBusResult<()>
Delete the channel for every Interface
, which the given sender is connected to
(see add_method_call_interface
).
pub fn add_signal(
&self,
object_path: ObjectPath,
filter: Option<fn(_: &Message) -> bool>,
sender: MpscSender<Message>
) -> DBusResult<()>
[src]
&self,
object_path: ObjectPath,
filter: Option<fn(_: &Message) -> bool>,
sender: MpscSender<Message>
) -> DBusResult<()>
Add a channel to a specific ObjectPath
.
The channel will receive all Signal
messages for the specified ObjectPath
.
The second argument specify a closure to filter the Message
. If the closure returns true
then the Message
will not be send to the channel.
There can be multiple channels, which will receive message of the specific ObjectPath
.
pub fn delete_signal_sender(
&self,
sender: MpscSender<Message>
) -> DBusResult<()>
[src]
&self,
sender: MpscSender<Message>
) -> DBusResult<()>
Delete the channel for every ObjectPath
, which the given sender is connected to
(see add_signal
).
pub fn delete_signal_receiver(
&self,
receiver: MpscReceiver<Message>
) -> DBusResult<()>
[src]
&self,
receiver: MpscReceiver<Message>
) -> DBusResult<()>
Delete the channel for every ObjectPath
, which the given sender is connected to
(see add_signal
).
pub async fn list_method_call<'_>(
&'_ self,
object_path: ObjectPath
) -> DBusResult<HashSet<String>>
[src]
&'_ self,
object_path: ObjectPath
) -> DBusResult<HashSet<String>>
List all ObjectPath
s under the given ObjectPath
.
This will only list the ObjectPath
for the MethodCall
messages
(see add_method_call
).
pub fn close(&self) -> DBusResult<()>
[src]
Close the DBus connection.
pub fn get_address(&self) -> &ServerAddress
[src]
Get the current path of the DBus daemon.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for DBus
impl Send for DBus
impl Sync for DBus
impl Unpin for DBus
impl !UnwindSafe for DBus
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,