[][src]Struct zbus::fdo::DBusProxy

pub struct DBusProxy<'c>(_);

Proxy for the org.freedesktop.DBus interface.

Implementations

impl<'c> DBusProxy<'c>[src]

pub fn new(conn: &Connection) -> Result<Self>[src]

Creates a new proxy with the default service & path.

pub fn new_for(
    conn: &Connection,
    destination: &'c str,
    path: &'c str
) -> Result<Self>
[src]

Creates a new proxy for the given destination and path.

pub fn new_for_owned(
    conn: Connection,
    destination: String,
    path: String
) -> Result<Self>
[src]

Same as new_for but takes ownership of the passed arguments.

pub fn new_for_path(conn: &Connection, path: &'c str) -> Result<Self>[src]

Creates a new proxy for the given path.

pub fn new_for_owned_path(conn: Connection, path: String) -> Result<Self>[src]

Same as new_for_path but takes ownership of the passed arguments.

pub fn into_inner(self) -> Proxy<'c>[src]

Consumes self, returning the underlying zbus::Proxy.

pub fn inner(&self) -> &Proxy<'_>[src]

The reference to the underlying zbus::Proxy.

pub fn add_match(&self, rule: &str) -> Result<()>[src]

Adds a match rule to match messages going through the message bus

pub fn get_adt_audit_session_data(&self, bus_name: &str) -> Result<Vec<u8>>[src]

Returns auditing data used by Solaris ADT, in an unspecified binary format.

pub fn get_connection_credentials(
    &self,
    bus_name: &str
) -> Result<HashMap<String, OwnedValue>>
[src]

Returns as many credentials as possible for the process connected to the server.

pub fn get_connection_selinux_security_context(
    &self,
    bus_name: &str
) -> Result<Vec<u8>>
[src]

Returns the security context used by SELinux, in an unspecified format.

pub fn get_connection_unix_process_id(&self, bus_name: &str) -> Result<u32>[src]

Returns the Unix process ID of the process connected to the server.

pub fn get_connection_unix_user(&self, bus_name: &str) -> Result<u32>[src]

Returns the Unix user ID of the process connected to the server.

pub fn get_id(&self) -> Result<String>[src]

Gets the unique ID of the bus.

pub fn get_name_owner(&self, name: &str) -> Result<String>[src]

Returns the unique connection name of the primary owner of the name given.

pub fn hello(&self) -> Result<String>[src]

Returns the unique name assigned to the connection.

pub fn list_activatable_names(&self) -> Result<Vec<String>>[src]

Returns a list of all names that can be activated on the bus.

pub fn list_names(&self) -> Result<Vec<String>>[src]

Returns a list of all currently-owned names on the bus.

pub fn list_queued_owners(&self, name: &str) -> Result<Vec<String>>[src]

List the connections currently queued for a bus name.

pub fn name_has_owner(&self, name: &str) -> Result<bool>[src]

Checks if the specified name exists (currently has an owner).

pub fn release_name(&self, name: &str) -> Result<()>[src]

Ask the message bus to release the method caller's claim to the given name.

pub fn reload_config(&self) -> Result<()>[src]

Reload server configuration.

pub fn remove_match(&self, rule: &str) -> Result<()>[src]

Removes the first rule that matches.

pub fn request_name(
    &self,
    name: &str,
    flags: BitFlags<RequestNameFlags>
) -> Result<RequestNameReply>
[src]

Ask the message bus to assign the given name to the method caller.

pub fn start_service_by_name(&self, name: &str, flags: u32) -> Result<u32>[src]

Tries to launch the executable associated with a name (service activation), as an explicit request.

pub fn update_activation_environment(
    &self,
    environment: HashMap<&str, &str>
) -> Result<()>
[src]

This method adds to or modifies that environment when activating services.

pub fn connect_name_owner_changed<H>(&self, mut handler: H) -> Result<()> where
    H: FnMut(&str, &str, &str) -> Result<()> + Send + 'static, 
[src]

Connect the handler for the NameOwnerChanged signal. This is a convenient wrapper around zbus::Proxy::connect_signal. This signal indicates that the owner of a name has changed. It's also the signal to use to detect the appearance of new names on the bus.

pub fn disconnect_name_owner_changed(&self) -> Result<bool>[src]

Disconnected the handler (if any) for the NameOwnerChanged signal. This is a convenient wrapper around zbus::Proxy::disconnect_signal. This signal indicates that the owner of a name has changed. It's also the signal to use to detect the appearance of new names on the bus.

pub fn connect_name_lost<H>(&self, mut handler: H) -> Result<()> where
    H: FnMut(&str) -> Result<()> + Send + 'static, 
[src]

Connect the handler for the NameLost signal. This is a convenient wrapper around zbus::Proxy::connect_signal. This signal is sent to a specific application when it loses ownership of a name.

pub fn disconnect_name_lost(&self) -> Result<bool>[src]

Disconnected the handler (if any) for the NameLost signal. This is a convenient wrapper around zbus::Proxy::disconnect_signal. This signal is sent to a specific application when it loses ownership of a name.

pub fn connect_name_acquired<H>(&self, mut handler: H) -> Result<()> where
    H: FnMut(&str) -> Result<()> + Send + 'static, 
[src]

Connect the handler for the NameAcquired signal. This is a convenient wrapper around zbus::Proxy::connect_signal. This signal is sent to a specific application when it gains ownership of a name.

pub fn disconnect_name_acquired(&self) -> Result<bool>[src]

Disconnected the handler (if any) for the NameAcquired signal. This is a convenient wrapper around zbus::Proxy::disconnect_signal. This signal is sent to a specific application when it gains ownership of a name.

pub fn features(&self) -> Result<Vec<String>>[src]

This property lists abstract “features” provided by the message bus, and can be used by clients to detect the capabilities of the message bus with which they are communicating.

pub fn interfaces(&self) -> Result<Vec<String>>[src]

This property lists interfaces provided by the /org/freedesktop/DBus object, and can be used by clients to detect the capabilities of the message bus with which they are communicating. Unlike the standard Introspectable interface, querying this property does ot require parsing XML. This property was added in version 1.11.x of the reference implementation of the message bus.

The standard org.freedesktop.DBus and org.freedesktop.DBus.Properties interfaces are not included in the value of this property, because their presence can be inferred from the fact that a method call on org.freedesktop.DBus.Properties asking for properties of org.freedesktop.DBus was successful. The standard org.freedesktop.DBus.Peer and org.freedesktop.DBus.Introspectable interfaces are not included in the value of this property either, because they do not indicate features of the message bus implementation.

pub fn introspect(&self) -> Result<String>[src]

Methods from Deref<Target = Proxy<'c>>

pub fn connection(&self) -> &Connection[src]

Get a reference to the associated connection.

pub fn destination(&self) -> &str[src]

Get a reference to the destination service name.

pub fn path(&self) -> &str[src]

Get a reference to the object path.

pub fn interface(&self) -> &str[src]

Get a reference to the interface.

pub fn introspect(&self) -> Result<String>[src]

Introspect the associated object, and return the XML description.

See the xml module for parsing the result.

pub fn get_property<T>(&self, property_name: &str) -> Result<T> where
    T: TryFrom<OwnedValue>, 
[src]

Get the property property_name.

Effectively, call the Get method of the org.freedesktop.DBus.Properties interface.

pub fn set_property<'t, T: 't>(
    &self,
    property_name: &str,
    value: T
) -> Result<()> where
    T: Into<Value<'t>>, 
[src]

Set the property property_name.

Effectively, call the Set method of the org.freedesktop.DBus.Properties interface.

pub fn call_method<B>(&self, method_name: &str, body: &B) -> Result<Message> where
    B: Serialize + Type
[src]

Call a method and return the reply.

Typically, you would want to use call method instead. Use this method if you need to deserialize the reply message manually (this way, you can avoid the memory allocation/copying, by deserializing the reply to an unowned type).

pub fn call<B, R>(&self, method_name: &str, body: &B) -> Result<R> where
    B: Serialize + Type,
    R: DeserializeOwned + Type
[src]

Call a method and return the reply body.

Use call_method instead if you need to deserialize the reply manually/separately.

pub fn connect_signal<H>(
    &self,
    signal_name: &'static str,
    handler: H
) -> Result<()> where
    H: FnMut(&Message) -> Result<()> + Send + 'static, 
[src]

Register a handler for signal named signal_name.

Once a handler is successfully registered, call Self::next_signal to wait for the next signal to arrive and be handled by its registered handler.

If the associated connnection is to a bus, a match rule is added for the signal on the bus so that the bus sends us the signals.

Errors

This method can fail if addition of the relevant match rule on the bus fails. You can safely unwrap the Result if you're certain that associated connnection is not a bus connection.

pub fn disconnect_signal(&self, signal_name: &'static str) -> Result<bool>[src]

Deregister the handler for the signal named signal_name.

If the associated connnection is to a bus, the match rule is removed for the signal on the bus so that the bus stops sending us the signal. This method returns Ok(true) if a handler was registered for signal_name and was removed by this call; Ok(false) otherwise.

Errors

This method can fail if removal of the relevant match rule on the bus fails. You can safely unwrap the Result if you're certain that associated connnection is not a bus connection.

pub fn next_signal(&self) -> Result<Option<Message>>[src]

Receive and handle the next incoming signal on the associated connection.

This method will wait for signal messages on the associated connection and call any handlers registered through the Self::connect_signal method. Signal handlers can be registered and deregistered from another threads during the call to this method.

If the signal message was handled by a handler, Ok(None) is returned. Otherwise, the received message is returned.

pub fn handle_signal(&self, msg: &Message) -> Result<bool>[src]

Handle the provided signal message.

Call any handlers registered through the Self::connect_signal method for the provided signal message.

If no errors are encountered, Ok(true) is returned if a handler was found and called for, the signal; Ok(false) otherwise.

Trait Implementations

impl<'c> AsMut<Proxy<'c>> for DBusProxy<'c>[src]

impl<'c> AsRef<Proxy<'c>> for DBusProxy<'c>[src]

impl<'c> Deref for DBusProxy<'c>[src]

type Target = Proxy<'c>

The resulting type after dereferencing.

impl<'c> DerefMut for DBusProxy<'c>[src]

Auto Trait Implementations

impl<'c> !RefUnwindSafe for DBusProxy<'c>[src]

impl<'c> Send for DBusProxy<'c>[src]

impl<'c> Sync for DBusProxy<'c>[src]

impl<'c> Unpin for DBusProxy<'c>[src]

impl<'c> !UnwindSafe for DBusProxy<'c>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.