pub struct ConnectionSimulator { /* private fields */ }Expand description
Connection simulator for testing connection handling.
Implementations§
Source§impl ConnectionSimulator
impl ConnectionSimulator
Sourcepub fn new(server_addr: SocketAddr) -> Self
pub fn new(server_addr: SocketAddr) -> Self
Create a new connection simulator.
Sourcepub async fn open_connections(&mut self, count: usize) -> Result<usize, String>
pub async fn open_connections(&mut self, count: usize) -> Result<usize, String>
Open N connections.
Sourcepub fn connection_count(&self) -> usize
pub fn connection_count(&self) -> usize
Get current connection count.
Sourcepub async fn verify_connections(&self) -> (usize, usize)
pub async fn verify_connections(&self) -> (usize, usize)
Test that all connections are still alive.
Auto Trait Implementations§
impl Freeze for ConnectionSimulator
impl RefUnwindSafe for ConnectionSimulator
impl Send for ConnectionSimulator
impl Sync for ConnectionSimulator
impl Unpin for ConnectionSimulator
impl UnsafeUnpin for ConnectionSimulator
impl UnwindSafe for ConnectionSimulator
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