pub struct Flags(/* private fields */);
Expand description
Flags inside of a D-Bus message.
§Examples
use tokio_dbus::Flags;
let flags = Flags::EMPTY;
assert!(!(flags & Flags::NO_REPLY_EXPECTED));
let flags = Flags::EMPTY | Flags::NO_REPLY_EXPECTED;
assert!(flags & Flags::NO_REPLY_EXPECTED);
assert!(!(flags & Flags::NO_AUTO_START));
Implementations§
Source§impl Flags
impl Flags
Sourcepub const NO_REPLY_EXPECTED: Flags
pub const NO_REPLY_EXPECTED: Flags
This message does not expect method return replies or error replies, even if it is of a type that can have a reply; the reply should be omitted.
Sourcepub const NO_AUTO_START: Flags
pub const NO_AUTO_START: Flags
The bus must not launch an owner for the destination name in response to this message.
Sourcepub const ALLOW_INTERACTIVE_AUTHORIZATION: Flags
pub const ALLOW_INTERACTIVE_AUTHORIZATION: Flags
This flag may be set on a method call message to inform the receiving side that the caller is prepared to wait for interactive authorization, which might take a considerable time to complete. For instance, if this flag is set, it would be appropriate to query the user for passwords or confirmation via Polkit or a similar framework.
This flag is only useful when unprivileged code calls a more privileged method call, and an authorization framework is deployed that allows possibly interactive authorization. If no such framework is deployed it has no effect. This flag should not be set by default by client implementations. If it is set, the caller should also set a suitably long timeout on the method call to make sure the user interaction may complete. This flag is only valid for method call messages, and shall be ignored otherwise.
Interaction that takes place as a part of the effect of the method being called is outside the scope of this flag, even if it could also be characterized as authentication or authorization. For instance, in a method call that directs a network management service to attempt to connect to a virtual private network, this flag should control how the network management service makes the decision “is this user allowed to change system network configuration?”, but it should not affect how or whether the network management service interacts with the user to obtain the credentials that are required for access to the VPN.
If a this flag is not set on a method call, and a service determines that the requested operation is not allowed without interactive authorization, but could be allowed after successful interactive authorization, it may return the org.freedesktop.DBus.Error.InteractiveAuthorizationRequired error.
The absence of this flag does not guarantee that interactive authorization will not be applied, since existing services that pre-date this flag might already use interactive authorization. However, existing D-Bus APIs that will use interactive authorization should document that the call may take longer than usual, and new D-Bus APIs should avoid interactive authorization in the absence of this flag.