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)
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 with_buf<F, R>(&self, f: F) -> Result<R>where
F: FnOnce(&WriteBuf<'_>) -> R,
pub fn with_buf<F, R>(&self, f: F) -> Result<R>where F: FnOnce(&WriteBuf<'_>) -> R,
Get access to write buffer
sourcepub fn with_write_buf<F, R>(&self, f: F) -> Result<R>where
F: FnOnce(&mut BytesVec) -> R,
pub fn with_write_buf<F, R>(&self, f: F) -> Result<R>where F: FnOnce(&mut BytesVec) -> R,
Get mut access to source 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 source 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
Trait Implementations§
source§impl PartialEq<IoRef> for IoRef
impl PartialEq<IoRef> for IoRef
impl Eq for IoRef
Auto Trait Implementations§
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