pub struct IoRef(_);Implementations
sourceimpl 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) -> R where
F: FnOnce(&mut BytesVec) -> R,
pub fn with_read_buf<F, R>(&self, f: F) -> R where
F: FnOnce(&mut BytesVec) -> R,
Get mut access to read buffer
sourcepub fn on_disconnect(&self) -> OnDisconnectⓘNotable traits for OnDisconnectimpl Future for OnDisconnect type Output = ();
pub fn on_disconnect(&self) -> OnDisconnectⓘNotable traits for OnDisconnectimpl Future for OnDisconnect type Output = ();
Notify when io stream get disconnected
Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more