Struct Handshake

Source
pub struct Handshake<C>
where C: ClusterAPI,
{ pub prefix: String, pub raddr: SocketAddr, pub config: Config, pub proto: Protocol, pub cluster: C, pub conn: Option<TcpStream>, }
Expand description

Type handles incoming connection.

Complete the handshake by sending the appropriate CONNACK packet. This type is threadable and spawned for every incoming connection, once the handshake is completed, connection is handed over to the Cluster.

Fields§

§prefix: String§raddr: SocketAddr§config: Config§proto: Protocol§cluster: C§conn: Option<TcpStream>

Trait Implementations§

Source§

impl<C> Threadable for Handshake<C>
where C: ClusterAPI,

Source§

type Req = ()

Request type that the implementing type can handle.
Source§

type Resp = ()

Response type that the implementing type shall return.
Source§

fn main_loop(self, _rx: Rx<(), ()>) -> Self

Entry point for the thread.
Source§

impl<C> ToJson for Handshake<C>
where C: ClusterAPI,

Source§

fn to_config_json(&self) -> String

Implementing type shall return configuration as JSON string.
Source§

fn to_stats_json(&self) -> String

Implementing type shall return statistics as JSON string.

Auto Trait Implementations§

§

impl<C> !Freeze for Handshake<C>

§

impl<C> RefUnwindSafe for Handshake<C>
where C: RefUnwindSafe,

§

impl<C> Send for Handshake<C>
where C: Send,

§

impl<C> Sync for Handshake<C>
where C: Sync,

§

impl<C> Unpin for Handshake<C>
where C: Unpin,

§

impl<C> UnwindSafe for Handshake<C>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.