Struct TungsteniteTransport
pub struct TungsteniteTransport { /* private fields */ }Expand description
WebSocket transport using tokio-tungstenite.
Implementations§
§impl TungsteniteTransport
impl TungsteniteTransport
pub fn new() -> TungsteniteTransport
pub fn new() -> TungsteniteTransport
Create a new, disconnected transport.
Trait Implementations§
§impl Default for TungsteniteTransport
impl Default for TungsteniteTransport
§fn default() -> TungsteniteTransport
fn default() -> TungsteniteTransport
Returns the “default value” for a type. Read more
§impl Transport for TungsteniteTransport
impl Transport for TungsteniteTransport
§fn connect<'life0, 'life1, 'async_trait>(
&'life0 mut self,
url: &'life1 str,
headers: Vec<(String, String)>,
) -> Pin<Box<dyn Future<Output = Result<(), <TungsteniteTransport as Transport>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TungsteniteTransport: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 mut self,
url: &'life1 str,
headers: Vec<(String, String)>,
) -> Pin<Box<dyn Future<Output = Result<(), <TungsteniteTransport as Transport>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TungsteniteTransport: 'async_trait,
Connect to the given URL with optional headers.
§fn send<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), <TungsteniteTransport as Transport>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
TungsteniteTransport: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), <TungsteniteTransport as Transport>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
TungsteniteTransport: 'async_trait,
Send raw bytes.
§fn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, <TungsteniteTransport as Transport>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
TungsteniteTransport: 'async_trait,
fn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, <TungsteniteTransport as Transport>::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
TungsteniteTransport: 'async_trait,
Receive raw bytes. Returns
None when the connection is closed.Auto Trait Implementations§
impl Freeze for TungsteniteTransport
impl !RefUnwindSafe for TungsteniteTransport
impl Send for TungsteniteTransport
impl Sync for TungsteniteTransport
impl Unpin for TungsteniteTransport
impl !UnwindSafe for TungsteniteTransport
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