pub struct IoRef(_);
Implementations§
source§impl IoRef
impl IoRef
sourcepub fn memory_pool(&self) -> PoolRef
pub fn memory_pool(&self) -> PoolRef
Get memory pool
sourcepub fn close(&self)
pub fn close(&self)
Gracefully close connection
Notify dispatcher and initiate io stream shutdown process.
sourcepub fn force_close(&self)
pub fn force_close(&self)
Force close connection
Dispatcher does not wait for uncompleted responses. Io stream get terminated without any graceful period.
sourcepub fn want_shutdown(&self, err: Option<Error>)
pub fn want_shutdown(&self, err: Option<Error>)
Gracefully shutdown io stream
sourcepub fn encode<U>(
&self,
item: U::Item,
codec: &U
) -> Result<(), <U as Encoder>::Error>where
U: Encoder,
pub fn encode<U>(
&self,
item: U::Item,
codec: &U
) -> Result<(), <U as Encoder>::Error>where
U: Encoder,
Encode and write item to a buffer and wake up write task
sourcepub fn decode<U>(
&self,
codec: &U
) -> Result<Option<<U as Decoder>::Item>, <U as Decoder>::Error>where
U: Decoder,
pub fn decode<U>(
&self,
codec: &U
) -> Result<Option<<U as Decoder>::Item>, <U as Decoder>::Error>where
U: Decoder,
Attempts to decode a frame from the read buffer
sourcepub fn with_write_buf<F, R>(&self, f: F) -> Result<R, Error>where
F: FnOnce(&mut BytesVec) -> R,
pub fn with_write_buf<F, R>(&self, f: F) -> Result<R, Error>where
F: FnOnce(&mut BytesVec) -> R,
Get mut access to write buffer
sourcepub fn with_read_buf<F, R>(&self, f: F) -> Rwhere
F: FnOnce(&mut BytesVec) -> R,
pub fn with_read_buf<F, R>(&self, f: F) -> Rwhere
F: FnOnce(&mut BytesVec) -> R,
Get mut access to read buffer
sourcepub fn start_keepalive_timer(&self, timeout: Duration)
pub fn start_keepalive_timer(&self, timeout: Duration)
Start keep-alive timer
sourcepub fn stop_keepalive_timer(&self)
pub fn stop_keepalive_timer(&self)
Stop keep-alive timer
sourcepub fn on_disconnect(&self) -> OnDisconnect ⓘ
pub fn on_disconnect(&self) -> OnDisconnect ⓘ
Notify when io stream get disconnected