Struct tokio_dbus::Flags

source ·
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

source

pub const EMPTY: Flags = _

An empty set of flags.

source

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.

source

pub const NO_AUTO_START: Flags = _

The bus must not launch an owner for the destination name in response to this message.

source

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.

Trait Implementations§

source§

impl BitAnd for Flags

§

type Output = bool

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Flags) -> <Flags as BitAnd>::Output

Performs the & operation. Read more
source§

impl BitOr for Flags

§

type Output = Flags

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Flags) -> <Flags as BitOr>::Output

Performs the | operation. Read more
source§

impl BitXor for Flags

§

type Output = Flags

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: Flags) -> <Flags as BitXor>::Output

Performs the ^ operation. Read more
source§

impl Clone for Flags

source§

fn clone(&self) -> Flags

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Flags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Flags

source§

fn default() -> Flags

Returns the “default value” for a type. Read more
source§

impl PartialEq for Flags

source§

fn eq(&self, other: &Flags) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Aligned for Flags

source§

impl Arguments for Flags

source§

impl Copy for Flags

source§

impl Eq for Flags

source§

impl Frame for Flags

source§

impl Marker for Flags

source§

impl Storable for Flags

source§

impl StructuralPartialEq for Flags

Auto Trait Implementations§

§

impl RefUnwindSafe for Flags

§

impl Send for Flags

§

impl Sync for Flags

§

impl Unpin for Flags

§

impl UnwindSafe for Flags

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.