[][src]Struct zbus::handshake::ClientHandshake

pub struct ClientHandshake<S> { /* fields omitted */ }

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]

Auto Trait Implementations

impl<S> RefUnwindSafe for ClientHandshake<S> where
    S: RefUnwindSafe
[src]

impl<S> Send for ClientHandshake<S> where
    S: Send
[src]

impl<S> Sync for ClientHandshake<S> where
    S: Sync
[src]

impl<S> Unpin for ClientHandshake<S> where
    S: Unpin
[src]

impl<S> UnwindSafe for ClientHandshake<S> where
    S: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.