pub struct MockWebSocketClient;Expand description
A mock WebSocket client for testing purposes.
This struct simulates a WebSocket client that always fails to connect, which is useful for testing reconnection logic and error handling.
Trait Implementations§
Source§impl Connectable for MockWebSocketClient
impl Connectable for MockWebSocketClient
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Simulates a connection failure for the mock WebSocket client.
This method always returns a ConnectionClosed error, simulating
a scenario where the WebSocket client cannot establish a connection.
Auto Trait Implementations§
impl Freeze for MockWebSocketClient
impl RefUnwindSafe for MockWebSocketClient
impl Send for MockWebSocketClient
impl Sync for MockWebSocketClient
impl Unpin for MockWebSocketClient
impl UnwindSafe for MockWebSocketClient
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