pub struct NativeTransport { /* private fields */ }Expand description
Tokio Tungstenite transport implementing the runtime-neutral transport API.
Implementations§
Source§impl NativeTransport
impl NativeTransport
Sourcepub async fn connect(url: &str) -> Result<Self, TransportError>
pub async fn connect(url: &str) -> Result<Self, TransportError>
Opens an already-resolved WebSocket URL with default options.
Trait Implementations§
Source§impl Transport for NativeTransport
impl Transport for NativeTransport
Source§fn send<'a>(
&'a mut self,
message: WireMessage,
) -> LocalBoxFuture<'a, Result<(), TransportError>>
fn send<'a>( &'a mut self, message: WireMessage, ) -> LocalBoxFuture<'a, Result<(), TransportError>>
Sends one complete wire message.
Source§fn receive<'a>(
&'a mut self,
) -> LocalBoxFuture<'a, Result<TransportEvent, TransportError>>
fn receive<'a>( &'a mut self, ) -> LocalBoxFuture<'a, Result<TransportEvent, TransportError>>
Waits for the next message or close notification.
Source§fn close<'a>(&'a mut self) -> LocalBoxFuture<'a, Result<(), TransportError>>
fn close<'a>(&'a mut self) -> LocalBoxFuture<'a, Result<(), TransportError>>
Closes the transport using its default close behavior.
Source§fn close_with<'a>(
&'a mut self,
request: TransportCloseRequest,
) -> LocalBoxFuture<'a, Result<(), TransportError>>
fn close_with<'a>( &'a mut self, request: TransportCloseRequest, ) -> LocalBoxFuture<'a, Result<(), TransportError>>
Closes the transport with an explicit WebSocket code and reason.
Source§fn supports_binary(&self) -> bool
fn supports_binary(&self) -> bool
Returns whether this transport can send Phoenix binary frames.
Auto Trait Implementations§
impl !Freeze for NativeTransport
impl !RefUnwindSafe for NativeTransport
impl Send for NativeTransport
impl Sync for NativeTransport
impl Unpin for NativeTransport
impl UnsafeUnpin for NativeTransport
impl !UnwindSafe for NativeTransport
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