[−][src]Struct zbus::handshake::ClientHandshake
A representation of an in-progress handshake, client-side
This struct is an async-compatible representation of the initial handshake that must be performed before
a D-Bus connection can be used. To use it, you should call the advance_handshake
method whenever the
underlying socket becomes ready (tracking the readiness itself is not managed by this abstraction) until
it returns Ok(())
, at which point you can invoke the try_finish
method to get an Authenticated
,
which can be given to Connection::new_authenticated
.
If handling the handshake asynchronously is not necessary, the blocking_finish
method is provided
which blocks until the handshake is completed or an error occurs.
Implementations
impl<S: Socket> ClientHandshake<S>
[src]
pub fn new(socket: S) -> ClientHandshake<S>
[src]
Start a handsake on this client socket
pub fn advance_handshake(&mut self) -> Result<()>
[src]
Same as Handshake::advance_handshake
. Only exists for backwards compatibility.
pub fn try_finish(self) -> Result<Authenticated<S>, Self>
[src]
Same as Handshake::try_finish
. Only exists for backwards compatibility.
pub fn socket(&self) -> &S
[src]
Same as Handshake::socket
. Only exists for backwards compatibility.
impl ClientHandshake<UnixStream>
[src]
pub fn new_session() -> Result<Self>
[src]
Initialize a handshake to the session/user message bus.
The socket backing this connection is created in blocking mode.
pub fn new_session_nonblock() -> Result<Self>
[src]
Initialize a handshake to the session/user message bus.
The socket backing this connection is created in non-blocking mode.
pub fn new_system() -> Result<Self>
[src]
Initialize a handshake to the system-wide message bus.
The socket backing this connection is created in blocking mode.
pub fn new_system_nonblock() -> Result<Self>
[src]
Initialize a handshake to the system-wide message bus.
The socket backing this connection is created in non-blocking mode.
pub fn new_for_address(address: &str) -> Result<Self>
[src]
Create a handshake for the given D-Bus address.
The socket backing this connection is created in blocking mode.
pub fn new_for_address_nonblock(address: &str) -> Result<Self>
[src]
Create a handshake for the given D-Bus address.
The socket backing this connection is created in non-blocking mode.
pub fn blocking_finish(self) -> Result<Authenticated<UnixStream>>
[src]
Block and automatically drive the handshake for this client
This method will block until the handshake is finalized, even if the socket is in non-blocking mode.
Trait Implementations
impl<S: Debug> Debug for ClientHandshake<S>
[src]
impl<S: Socket> Handshake<S> for ClientHandshake<S>
[src]
pub fn next_io_operation(&self) -> IoOperation
[src]
pub fn advance_handshake(&mut self) -> Result<()>
[src]
pub fn try_finish(self) -> Result<Authenticated<S>, Self>
[src]
pub fn socket(&self) -> &S
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for ClientHandshake<S> where
S: RefUnwindSafe,
[src]
S: RefUnwindSafe,
impl<S> Send for ClientHandshake<S> where
S: Send,
[src]
S: Send,
impl<S> Sync for ClientHandshake<S> where
S: Sync,
[src]
S: Sync,
impl<S> Unpin for ClientHandshake<S> where
S: Unpin,
[src]
S: Unpin,
impl<S> UnwindSafe for ClientHandshake<S> where
S: UnwindSafe,
[src]
S: UnwindSafe,
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,
pub 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.
pub 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>,