Struct makiko::ClientReceiver

source ·
pub struct ClientReceiver { /* private fields */ }
Expand description

Receiving half of a Client.

ClientReceiver provides you with the ClientEvents, various events that are produced during the life of the connection. You can usually ignore them, except ClientEvent::ServerPubkey, which is used to verify the server’s public key (if you ignore that event, we assume that you reject the key and we abort the connection). However, you must receive these events, otherwise the client will stall when the internal buffer of events fills up.

Implementations§

source§

impl ClientReceiver

source

pub async fn recv(&mut self) -> Result<Option<ClientEvent>>

Wait for the next event.

Returns None if the connection was closed.

source

pub fn poll_recv( &mut self, cx: &mut Context<'_> ) -> Poll<Result<Option<ClientEvent>>>

Poll-friendly variant of .recv().

source

pub fn specialize_channels(&mut self, enable: bool)

Control whether we should treat some ClientEvent::Channel events specially (low level API).

When the server attempts to open a channel, we normally give you a ClientEvent::Channel. However, to provide a higher level API, we treat some channels specially: when the channel type is "forwarded-tcpip", you will get a ClientEvent::Tunnel event instead of ClientEvent::Channel event, so you can easily work with the high-level Tunnel API instead of the low-level Channel API.

In most cases, the default behavior is perfectly OK and you want to keep this enabled. But if you want to use the low-level API, you can disable this behavior by calling this method with false.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V