pub struct BridgeClient { /* private fields */ }Expand description
A live connection to a spawned bridge process, multiplexing D-Bus and stream channels over its stdio.
Implementations§
Source§impl BridgeClient
impl BridgeClient
Sourcepub fn connect(transport: &dyn Transport) -> Result<BridgeClient>
pub fn connect(transport: &dyn Transport) -> Result<BridgeClient>
Spawn the bridge via transport, perform the init handshake, and return
a ready client.
Sourcepub fn dbus_open(&mut self, name: &str) -> Result<String>
pub fn dbus_open(&mut self, name: &str) -> Result<String>
Open an unprivileged D-Bus channel to name and return its channel id.
Sourcepub fn dbus_open_privileged(&mut self, name: &str) -> Result<String>
pub fn dbus_open_privileged(&mut self, name: &str) -> Result<String>
Open a privileged D-Bus channel (superuser: "require"); the bridge
performs the sudo/polkit escalation and spawns a root peer (Section 5).
Sourcepub fn dbus_call(
&mut self,
channel: &str,
path: &str,
iface: &str,
method: &str,
args: Value,
) -> Result<Value>
pub fn dbus_call( &mut self, channel: &str, path: &str, iface: &str, method: &str, args: Value, ) -> Result<Value>
Returns the out-argument array (reply[0]). Index [0] for the first return value.
Sourcepub fn stream_collect(&mut self, argv: &[&str]) -> Result<Vec<u8>>
pub fn stream_collect(&mut self, argv: &[&str]) -> Result<Vec<u8>>
Open a stream channel running argv and buffer its output until done.
Trait Implementations§
Source§impl Drop for BridgeClient
impl Drop for BridgeClient
Auto Trait Implementations§
impl !Sync for BridgeClient
impl Freeze for BridgeClient
impl RefUnwindSafe for BridgeClient
impl Send for BridgeClient
impl Unpin for BridgeClient
impl UnsafeUnpin for BridgeClient
impl UnwindSafe for BridgeClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more