zbus/fdo/monitoring.rs
1//! D-Bus standard interfaces.
2//!
3//! The D-Bus specification defines the message bus messages and some standard interfaces that may
4//! be useful across various D-Bus applications. This module provides their proxy.
5
6/// Proxy for the `org.freedesktop.DBus.Monitoring` interface.
7#[crate::proxy(
8 interface = "org.freedesktop.DBus.Monitoring",
9 default_service = "org.freedesktop.DBus",
10 default_path = "/org/freedesktop/DBus"
11)]
12pub trait Monitoring {
13 /// Converts the connection into a monitor connection which can be used as a
14 /// debugging/monitoring tool.
15 ///
16 /// After this call successfully returns, sending any messages on the bus will result
17 /// in an error. This is why this method takes ownership of `self`, since there is not
18 /// much use for the proxy anymore. It is highly recommended to convert the underlying
19 /// [`Connection`] to a [`MessageStream`] and iterate over messages from the stream,
20 /// after this call.
21 ///
22 /// See [the spec] for details on all the implications and caveats.
23 ///
24 /// # Arguments
25 ///
26 /// * `match_rules` - A list of match rules describing the messages you want to receive. An
27 /// empty list means you are want to receive all messages going through the bus.
28 /// * `flags` - This argument is currently unused by the bus. Just pass a `0`.
29 ///
30 /// [the spec]: https://dbus.freedesktop.org/doc/dbus-specification.html#bus-messages-become-monitor
31 /// [`Connection`]: https://docs.rs/zbus/latest/zbus/connection/struct.Connection.html
32 /// [`MessageStream`]: https://docs.rs/zbus/latest/zbus/struct.MessageStream.html
33 fn become_monitor(self, match_rules: &[crate::MatchRule<'_>], flags: u32) -> super::Result<()>;
34}