[][src]Struct dbus::blocking::LocalConnection

pub struct LocalConnection { /* fields omitted */ }

A connection to D-Bus, thread local + non-async version

Implementations

impl LocalConnection[src]

pub fn new_session() -> Result<Self, Error>[src]

Create a new connection to the session bus.

pub fn new_system() -> Result<Self, Error>[src]

Create a new connection to the system-wide bus.

pub fn unique_name(&self) -> BusName[src]

Get the connection's unique name.

It's usually something like ":1.54"

pub fn with_proxy<'a, 'b, D: Into<BusName<'a>>, P: Into<Path<'a>>>(
    &'b self,
    dest: D,
    path: P,
    timeout: Duration
) -> Proxy<'a, &'b Self>
[src]

Create a convenience struct for easier calling of many methods on the same destination and path.

pub fn request_name<'a, N: Into<BusName<'a>>>(
    &self,
    name: N,
    allow_replacement: bool,
    replace_existing: bool,
    do_not_queue: bool
) -> Result<RequestNameReply, Error>
[src]

Request a name on the D-Bus.

For detailed information on the flags and return values, see the libdbus documentation.

pub fn release_name<'a, N: Into<BusName<'a>>>(
    &self,
    name: N
) -> Result<ReleaseNameReply, Error>
[src]

Release a previously requested name on the D-Bus.

pub fn add_match<S: ReadAll, F>(
    &self,
    match_rule: MatchRule<'static>,
    f: F
) -> Result<Token, Error> where
    F: FnMut(S, &Self, &Message) -> bool + 'static, 
[src]

Adds a new match to the connection, and sets up a callback when this message arrives.

The returned value can be used to remove the match. The match is also removed if the callback returns "false".

pub fn add_match_no_cb(&self, match_str: &str) -> Result<(), Error>[src]

Adds a new match to the connection, without setting up a callback when this message arrives.

pub fn remove_match_no_cb(&self, match_str: &str) -> Result<(), Error>[src]

Removes a match from the connection, without removing any callbacks.

pub fn remove_match(&self, id: Token) -> Result<(), Error>[src]

Removes a previously added match and callback from the connection.

pub fn process(&self, timeout: Duration) -> Result<bool, Error>[src]

Tries to handle an incoming message if there is one. If there isn't one, it will wait up to timeout

This method only takes "&self" instead of "&mut self", but it is a logic error to call it recursively and might lead to panics or deadlocks.

pub fn channel(&self) -> &Channel[src]

The channel for this connection

Trait Implementations

impl BlockingSender for LocalConnection[src]

impl From<Channel> for LocalConnection[src]

impl<S: ReadAll, F: FnMut(S, &LocalConnection, &Message) -> bool + 'static> MakeSignal<Box<dyn FnMut(Message, &LocalConnection) + 'static>, S, LocalConnection> for F[src]

impl MatchingReceiver for LocalConnection[src]

type F = Box<dyn FnMut(Message, &LocalConnection) -> bool + 'static>

Type of callback

impl Sender for LocalConnection[src]

Auto Trait Implementations

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.