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