pub struct WebSocketTransport { /* private fields */ }Implementations§
Source§impl WebSocketTransport
impl WebSocketTransport
pub fn new(url: String) -> Self
pub fn with_reconnect_config( url: String, _max_attempts: usize, _delay_ms: u32, ) -> Self
pub async fn connect(&self) -> Result<(), TransportError>
pub async fn disconnect(&self) -> Result<(), TransportError>
pub async fn send_binary(&self, _data: &[u8]) -> Result<(), TransportError>
pub async fn send_text(&self, _text: &str) -> Result<(), TransportError>
Trait Implementations§
Source§impl Clone for WebSocketTransport
impl Clone for WebSocketTransport
Source§impl SyncTransport for WebSocketTransport
impl SyncTransport for WebSocketTransport
type Error = TransportError
Source§fn send(
&self,
_data: &[u8],
) -> impl Future<Output = Result<(), Self::Error>> + Send
fn send( &self, _data: &[u8], ) -> impl Future<Output = Result<(), Self::Error>> + Send
Send data to remote peers
Source§fn receive(
&self,
) -> impl Future<Output = Result<Vec<Vec<u8>>, Self::Error>> + Send
fn receive( &self, ) -> impl Future<Output = Result<Vec<Vec<u8>>, Self::Error>> + Send
Receive data from remote peers
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if transport is connected
Auto Trait Implementations§
impl Freeze for WebSocketTransport
impl !RefUnwindSafe for WebSocketTransport
impl Send for WebSocketTransport
impl Sync for WebSocketTransport
impl Unpin for WebSocketTransport
impl !UnwindSafe for WebSocketTransport
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