pub struct NetBenchTest { /* private fields */ }Expand description
A running benchmark.
Implementations§
Source§impl NetBenchTest
impl NetBenchTest
Sourcepub async fn next(&mut self) -> Option<NetBenchEvent>
pub async fn next(&mut self) -> Option<NetBenchEvent>
Waits for the next progress event.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Cancels the benchmark task without closing the caller-owned connection.
Call Self::abort_and_wait when the caller must prove that the internal task has exited.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns whether the internal benchmark task has finished.
Sourcepub async fn abort_and_wait(self) -> Result<()>
pub async fn abort_and_wait(self) -> Result<()>
Cancels the benchmark and waits until its internal task has exited.
§Errors
Returns an error if the task panicked while cancellation was racing with completion.
Sourcepub async fn result(self) -> Result<NetBenchReport>
pub async fn result(self) -> Result<NetBenchReport>
Trait Implementations§
Source§impl Debug for NetBenchTest
impl Debug for NetBenchTest
Source§impl Drop for NetBenchTest
impl Drop for NetBenchTest
Auto Trait Implementations§
impl Freeze for NetBenchTest
impl RefUnwindSafe for NetBenchTest
impl Send for NetBenchTest
impl Sync for NetBenchTest
impl Unpin for NetBenchTest
impl UnsafeUnpin for NetBenchTest
impl UnwindSafe for NetBenchTest
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