[−][src]Struct dbus::blocking::Proxy
A struct that wraps a connection, destination and path.
A D-Bus "Proxy" is a client-side object that corresponds to a remote object on the server side. Calling methods on the proxy object calls methods on the remote object. Read more in the D-Bus tutorial
Fields
destination: BusName<'a>
Destination, i e what D-Bus service you're communicating with
path: Path<'a>
Object path on the destination
timeout: Duration
Timeout for method calls
connection: C
Some way to send and/or receive messages, either blocking or non-blocking.
Methods
impl<'a, C> Proxy<'a, C>
[src]
pub fn new<D: Into<BusName<'a>>, P: Into<Path<'a>>>(
dest: D,
path: P,
timeout: Duration,
connection: C
) -> Self
[src]
dest: D,
path: P,
timeout: Duration,
connection: C
) -> Self
Creates a new proxy struct.
impl<'a, T: BlockingSender, C: Deref<Target = T>> Proxy<'a, C>
[src]
pub fn method_call<'i, 'm, R: ReadAll, A: AppendAll, I: Into<Interface<'i>>, M: Into<Member<'m>>>(
&self,
i: I,
m: M,
args: A
) -> Result<R, Error>
[src]
&self,
i: I,
m: M,
args: A
) -> Result<R, Error>
Make a method call using typed input and output arguments, then block waiting for a reply.
Example
use dbus::blocking::{Connection, Proxy}; let conn = Connection::new_session()?; let proxy = Proxy::new("org.freedesktop.DBus", "/", std::time::Duration::from_millis(5000), &conn); let (has_owner,): (bool,) = proxy.method_call("org.freedesktop.DBus", "NameHasOwner", ("dummy.name.without.owner",))?; assert_eq!(has_owner, false);
pub fn match_start(
&self,
mr: MatchRule<'static>,
call_add_match: bool,
f: <T as MatchingReceiver>::F
) -> Result<u32, Error> where
T: MatchingReceiver,
[src]
&self,
mr: MatchRule<'static>,
call_add_match: bool,
f: <T as MatchingReceiver>::F
) -> Result<u32, Error> where
T: MatchingReceiver,
Starts matching incoming messages on this destination and path.
For matching signals, match_signal_local or match_signal_sync might be more convenient.
The match rule will be modified to include this path and destination only.
If call_add_match is true, will notify the D-Bus server that matching should start.
pub fn match_stop(&self, id: u32, call_remove_match: bool) -> Result<(), Error> where
T: MatchingReceiver,
[src]
T: MatchingReceiver,
Stops matching a signal added with match_start, match_signal_local or match_signal_sync.
If call_add_match is true, will notify the D-Bus server that matching should stop, this should be true in case match_signal_local or match_signal_sync was used.
impl<'a, T, C> Proxy<'a, C> where
T: BlockingSender + MatchingReceiver<F = Box<dyn FnMut(Message, &T) -> bool + 'static>>,
C: Deref<Target = T>,
[src]
T: BlockingSender + MatchingReceiver<F = Box<dyn FnMut(Message, &T) -> bool + 'static>>,
C: Deref<Target = T>,
pub fn match_signal_local<S: SignalArgs + ReadAll, F>(
&self,
f: F
) -> Result<u32, Error> where
F: for<'b> FnMut(S, &'b T) -> bool + 'static,
[src]
&self,
f: F
) -> Result<u32, Error> where
F: for<'b> FnMut(S, &'b T) -> bool + 'static,
Sets up an incoming signal match, that calls the supplied callback every time the signal is received.
The returned value can be used to remove the match. The match is also removed if the callback returns "false".
impl<'a, T, C> Proxy<'a, C> where
T: BlockingSender + Send + Sync + MatchingReceiver<F = Box<dyn FnMut(Message, &T) -> bool + Send + Sync + 'static>>,
C: Deref<Target = T>,
[src]
T: BlockingSender + Send + Sync + MatchingReceiver<F = Box<dyn FnMut(Message, &T) -> bool + Send + Sync + 'static>>,
C: Deref<Target = T>,
pub fn match_signal_sync<S: SignalArgs + ReadAll, F>(
&self,
f: F
) -> Result<u32, Error> where
F: for<'b> FnMut(S, &'b T) -> bool + Send + Sync + 'static,
[src]
&self,
f: F
) -> Result<u32, Error> where
F: for<'b> FnMut(S, &'b T) -> bool + Send + Sync + 'static,
Sets up an incoming signal match, that calls the supplied callback every time the signal is received.
The returned value can be used to remove the match. The match is also removed if the callback returns "false".
Trait Implementations
impl<'a, T: BlockingSender, C: Deref<Target = T>> Properties for Proxy<'a, C>
[src]
fn get<R0: for<'b> Get<'b>>(
&self,
interface_name: &str,
property_name: &str
) -> Result<R0, Error>
[src]
&self,
interface_name: &str,
property_name: &str
) -> Result<R0, Error>
fn get_all(
&self,
interface_name: &str
) -> Result<HashMap<String, Variant<Box<dyn RefArg + 'static>>>, Error>
[src]
&self,
interface_name: &str
) -> Result<HashMap<String, Variant<Box<dyn RefArg + 'static>>>, Error>
fn set<I2: Arg + Append>(
&self,
interface_name: &str,
property_name: &str,
value: Variant<I2>
) -> Result<(), Error>
[src]
&self,
interface_name: &str,
property_name: &str,
value: Variant<I2>
) -> Result<(), Error>
impl<'a, C: Deref<Target = Connection>> Introspectable for Proxy<'a, C>
[src]
fn introspect(&self) -> Result<String, Error>
[src]
impl<'a, C: Deref<Target = Connection>> Peer for Proxy<'a, C>
[src]
impl<'a, C: Clone> Clone for Proxy<'a, C>
[src]
fn clone(&self) -> Proxy<'a, C>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, C: Debug> Debug for Proxy<'a, C>
[src]
Auto Trait Implementations
impl<'a, C> Send for Proxy<'a, C> where
C: Send,
C: Send,
impl<'a, C> Unpin for Proxy<'a, C> where
C: Unpin,
C: Unpin,
impl<'a, C> Sync for Proxy<'a, C> where
C: Sync,
C: Sync,
impl<'a, C> UnwindSafe for Proxy<'a, C> where
C: UnwindSafe,
C: UnwindSafe,
impl<'a, C> RefUnwindSafe for Proxy<'a, C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,