Struct tokio_test::io::Handle
source · pub struct Handle { /* private fields */ }Expand description
A handle to send additional actions to the related Mock.
Implementations§
source§impl Handle
impl Handle
sourcepub fn read(&mut self, buf: &[u8]) -> &mut Self
pub fn read(&mut self, buf: &[u8]) -> &mut Self
Sequence a read operation.
The next operation in the mock’s script will be to expect a read call
and return buf.
sourcepub fn read_error(&mut self, error: Error) -> &mut Self
pub fn read_error(&mut self, error: Error) -> &mut Self
Sequence a read operation error.
The next operation in the mock’s script will be to expect a read call
and return error.
sourcepub fn write(&mut self, buf: &[u8]) -> &mut Self
pub fn write(&mut self, buf: &[u8]) -> &mut Self
Sequence a write operation.
The next operation in the mock’s script will be to expect a write
call.
sourcepub fn write_error(&mut self, error: Error) -> &mut Self
pub fn write_error(&mut self, error: Error) -> &mut Self
Sequence a write operation error.
The next operation in the mock’s script will be to expect a write
call error.