[−][src]Struct dbus::blocking::LocalConnection
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]
&'b self,
dest: D,
path: P,
timeout: Duration
) -> Proxy<'a, &'b Self>
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]
&self,
name: N,
allow_replacement: bool,
replace_existing: bool,
do_not_queue: bool
) -> Result<RequestNameReply, Error>
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]
&self,
name: N
) -> Result<ReleaseNameReply, Error>
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]
&self,
match_rule: MatchRule<'static>,
f: F
) -> Result<Token, Error> where
F: FnMut(S, &Self, &Message) -> bool + 'static,
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]
fn send_with_reply_and_block(
&self,
msg: Message,
timeout: Duration
) -> Result<Message, Error>
[src]
&self,
msg: Message,
timeout: Duration
) -> Result<Message, Error>
impl From<Channel> for LocalConnection
[src]
fn from(channel: Channel) -> 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
fn start_receive(&self, m: MatchRule<'static>, f: Self::F) -> Token
[src]
fn stop_receive(&self, id: Token) -> Option<(MatchRule<'static>, Self::F)>
[src]
impl Sender for LocalConnection
[src]
Auto Trait Implementations
impl !RefUnwindSafe for LocalConnection
impl !Send for LocalConnection
impl !Sync for LocalConnection
impl Unpin for LocalConnection
impl !UnwindSafe for LocalConnection
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,