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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Handle
impl !RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl !UnwindSafe for Handle
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