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) -> R
pub fn local_buffer<F, R>(&self, f: F) -> R
Access read buffer.
sourcepub fn remote_buffer<F, R>(&self, f: F) -> R
pub fn remote_buffer<F, R>(&self, f: F) -> 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
pub fn poll_read_buf( &self, cx: &mut Context<'_>, buf: &mut BytesVec, ) -> Poll<Result<usize>>
pub fn poll_write_buf( &self, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IoTest
impl RefUnwindSafe for IoTest
impl Send for IoTest
impl Sync for IoTest
impl Unpin for IoTest
impl UnwindSafe for IoTest
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
)