pub struct IoRef(/* private fields */);
Implementations§
source§impl IoRef
impl IoRef
sourcepub fn memory_pool(&self) -> PoolRef
pub fn memory_pool(&self) -> PoolRef
Get memory pool
sourcepub fn is_wr_backpressure(&self) -> bool
pub fn is_wr_backpressure(&self) -> bool
Check if write back-pressure is enabled
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)
pub fn want_shutdown(&self)
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 decode_item<U>(
&self,
codec: &U,
) -> Result<Decoded<<U as Decoder>::Item>, <U as Decoder>::Error>where
U: Decoder,
pub fn decode_item<U>(
&self,
codec: &U,
) -> Result<Decoded<<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>
pub fn with_write_buf<F, R>(&self, f: F) -> Result<R>
Get mut access to source write buffer
sourcepub fn with_read_buf<F, R>(&self, f: F) -> R
pub fn with_read_buf<F, R>(&self, f: F) -> R
Get mut access to source read buffer
sourcepub fn notify_dispatcher(&self)
pub fn notify_dispatcher(&self)
Wakeup dispatcher
sourcepub fn notify_timeout(&self)
pub fn notify_timeout(&self)
Wakeup dispatcher and send keep-alive error
sourcepub fn timer_handle(&self) -> TimerHandle
pub fn timer_handle(&self) -> TimerHandle
current timer handle
sourcepub fn start_timer(&self, timeout: Seconds) -> TimerHandle
pub fn start_timer(&self, timeout: Seconds) -> TimerHandle
Start timer
sourcepub fn stop_timer(&self)
pub fn stop_timer(&self)
Stop timer
sourcepub fn on_disconnect(&self) -> OnDisconnect ⓘ
pub fn on_disconnect(&self) -> OnDisconnect ⓘ
Notify when io stream get disconnected
Trait Implementations§
impl Eq for IoRef
Auto Trait Implementations§
impl Freeze for IoRef
impl !RefUnwindSafe for IoRef
impl !Send for IoRef
impl !Sync for IoRef
impl Unpin for IoRef
impl !UnwindSafe for IoRef
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)