pub struct WsToStream<T: AsyncRead + AsyncWrite + Unpin + Send + 'static, A: ToSocketAddrs> { /* private fields */ }Expand description
将websocket的流量转化成的tcp流量
Implementations§
Source§impl<T: AsyncRead + AsyncWrite + Unpin + Send + 'static, A: ToSocketAddrs> WsToStream<T, A>
impl<T: AsyncRead + AsyncWrite + Unpin + Send + 'static, A: ToSocketAddrs> WsToStream<T, A>
pub fn new(io: T, addr: A) -> ProtResult<Self>
pub fn set_domain(&mut self, domain: String)
pub async fn copy_bidirectional(self) -> ProtResult<()>
pub async fn bind<S>( io: S, ws_sender: Sender<OwnedMessage>, stream_receiver: Receiver<Vec<u8>>, ) -> ProtResult<()>
Auto Trait Implementations§
impl<T, A> Freeze for WsToStream<T, A>
impl<T, A> RefUnwindSafe for WsToStream<T, A>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> Send for WsToStream<T, A>where
A: Send,
impl<T, A> Sync for WsToStream<T, A>
impl<T, A> Unpin for WsToStream<T, A>where
A: Unpin,
impl<T, A> UnsafeUnpin for WsToStream<T, A>where
A: UnsafeUnpin,
T: UnsafeUnpin,
impl<T, A> UnwindSafe for WsToStream<T, A>where
A: UnwindSafe,
T: UnwindSafe,
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