pub struct IoTest { /* private fields */ }Expand description
Async io stream
Implementations§
source§impl IoTest
impl IoTest
pub fn is_client_dropped(&self) -> bool
pub fn is_server_dropped(&self) -> bool
sourcepub fn set_peer_addr(self, addr: SocketAddr) -> Self
pub fn set_peer_addr(self, addr: SocketAddr) -> Self
Set peer addr
sourcepub fn read_pending(&self)
pub fn read_pending(&self)
Set read to Pending state
sourcepub fn read_error(&self, err: Error)
pub fn read_error(&self, err: Error)
Set read to error
sourcepub fn write_error(&self, err: Error)
pub fn write_error(&self, err: Error)
Set write error on remote side
sourcepub fn local_buffer<F, R>(&self, f: F) -> Rwhere
F: FnOnce(&mut BytesVec) -> R,
pub fn local_buffer<F, R>(&self, f: F) -> Rwhere
F: FnOnce(&mut BytesVec) -> R,
Access read buffer.
sourcepub fn remote_buffer<F, R>(&self, f: F) -> Rwhere
F: FnOnce(&mut BytesVec) -> R,
pub fn remote_buffer<F, R>(&self, f: F) -> Rwhere
F: FnOnce(&mut BytesVec) -> R,
Access remote buffer.
sourcepub fn write<T: AsRef<[u8]>>(&self, data: T)
pub fn write<T: AsRef<[u8]>>(&self, data: T)
Add extra data to the remote buffer and notify reader
sourcepub fn remote_buffer_cap(&self, cap: usize)
pub fn remote_buffer_cap(&self, cap: usize)
Read any available data
sourcepub async fn read(&self) -> Result<Bytes, Error>
pub async fn read(&self) -> Result<Bytes, Error>
Read data, if data is not available wait for it