[][src]Struct zbus::handshake::ServerHandshake

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

A representation of an in-progress handshake, server-side

This would typically be used to implement a D-Bus broker, or in the context of a P2P connection.

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> ServerHandshake<S>[src]

pub fn new(socket: S, guid: Guid, client_uid: u32) -> ServerHandshake<S>[src]

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 ServerHandshake<UnixStream>[src]

pub fn blocking_finish(self) -> Result<Authenticated<UnixStream>>[src]

Block and automatically drive the handshake for this server

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 ServerHandshake<S>[src]

impl<S: Socket> Handshake<S> for ServerHandshake<S>[src]

Auto Trait Implementations

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

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

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

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

impl<S> UnwindSafe for ServerHandshake<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.