pub struct ConnPath<'a, C> {
pub conn: C,
pub dest: BusName<'a>,
pub path: Path<'a>,
pub timeout: i32,
}
Expand description
A convenience struct that wraps connection, destination and path.
Useful if you want to make many method calls to the same destination path.
Fields
conn: C
Some way to access the connection, e g a &Connection or Rc
dest: BusName<'a>
Destination, i e what D-Bus service you’re communicating with
path: Path<'a>
Object path on the destination
timeout: i32
Timeout in milliseconds for blocking method calls
Implementations
sourceimpl<'a, C: Deref<Target = Connection>> ConnPath<'a, C>
impl<'a, C: Deref<Target = Connection>> ConnPath<'a, C>
sourcepub fn method_call_with_args<F: FnOnce(&mut Message)>(
&self,
i: &Interface<'_>,
m: &Member<'_>,
f: F
) -> Result<Message, Error>
pub fn method_call_with_args<F: FnOnce(&mut Message)>(
&self,
i: &Interface<'_>,
m: &Member<'_>,
f: F
) -> Result<Message, Error>
Make a D-Bus method call, where you can append arguments inside the closure.
sourcepub fn signal_with_args<F: FnOnce(&mut Message)>(
&self,
i: &Interface<'_>,
m: &Member<'_>,
f: F
) -> Result<u32, Error>
pub fn signal_with_args<F: FnOnce(&mut Message)>(
&self,
i: &Interface<'_>,
m: &Member<'_>,
f: F
) -> Result<u32, Error>
Emit a D-Bus signal, where you can append arguments inside the closure.
sourcepub fn emit<S: SignalArgs + AppendAll>(&self, signal: &S) -> Result<u32, Error>
pub fn emit<S: SignalArgs + AppendAll>(&self, signal: &S) -> Result<u32, Error>
Emit a D-Bus signal, where the arguments are in a struct.
sourcepub 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>
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>
Make a method call using typed input and output arguments.
Example
use dbus::ffidisp::{Connection, BusType};
let conn = Connection::get_private(BusType::Session)?;
let dest = conn.with_path("org.freedesktop.DBus", "/", 5000);
let (has_owner,): (bool,) = dest.method_call("org.freedesktop.DBus", "NameHasOwner", ("dummy.name.without.owner",))?;
assert_eq!(has_owner, false);
Trait Implementations
sourceimpl<'a, C: Deref<Target = Connection>> Introspectable for ConnPath<'a, C>
impl<'a, C: Deref<Target = Connection>> Introspectable for ConnPath<'a, C>
sourceimpl<'a, C: Deref<Target = Connection>> ObjectManager for ConnPath<'a, C>
impl<'a, C: Deref<Target = Connection>> ObjectManager for ConnPath<'a, C>
sourceimpl<'a, C: Deref<Target = Connection>> Peer for ConnPath<'a, C>
impl<'a, C: Deref<Target = Connection>> Peer for ConnPath<'a, C>
sourceimpl<'a, C: Deref<Target = Connection>> Properties for ConnPath<'a, C>
impl<'a, C: Deref<Target = Connection>> Properties for ConnPath<'a, C>
type Err = Error
fn get<R0: for<'b> Get<'b>>(
&self,
interface_name: &str,
property_name: &str
) -> Result<R0, Self::Err>
fn get_all(
&self,
interface_name: &str
) -> Result<HashMap<String, Variant<Box<dyn RefArg>>>, Self::Err>
fn set<I2: Arg + Append>(
&self,
interface_name: &str,
property_name: &str,
value: I2
) -> Result<(), Self::Err>
Auto Trait Implementations
impl<'a, C> RefUnwindSafe for ConnPath<'a, C>where
C: RefUnwindSafe,
impl<'a, C> Send for ConnPath<'a, C>where
C: Send,
impl<'a, C> Sync for ConnPath<'a, C>where
C: Sync,
impl<'a, C> Unpin for ConnPath<'a, C>where
C: Unpin,
impl<'a, C> UnwindSafe for ConnPath<'a, C>where
C: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more