pub struct WsReader { /* private fields */ }Expand description
Implementations§
Source§impl WsReader
impl WsReader
Sourcepub fn set_auto_pong(&mut self, on: bool)
pub fn set_auto_pong(&mut self, on: bool)
Enable/disable automatic PONG replies to pings (curl’s
CURLWS_NOAUTOPONG). Affects recv_event only;
recv always auto-pongs.
Sourcepub fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
pub fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
Set the per-read inactivity timeout. None blocks indefinitely.
Sourcepub fn shutdown_handle(&self) -> Option<WsShutdown>
pub fn shutdown_handle(&self) -> Option<WsShutdown>
A handle to force-close the socket from another thread, unblocking this
reader if it’s parked in recv. See WsShutdown.
Sourcepub fn recv(&mut self) -> Result<Option<WsMessage>>
pub fn recv(&mut self) -> Result<Option<WsMessage>>
Block until the next data message arrives, auto-answering interleaved
control frames. Ok(None) once the peer closes.
Sourcepub fn recv_event(&mut self) -> Result<WsEvent>
pub fn recv_event(&mut self) -> Result<WsEvent>
Receive the next WsEvent, surfacing control frames. A ping is
auto-ponged (through the shared, write-serialized transport) unless
auto-pong is off; a close is echoed.
Sourcepub fn recv_frame(&mut self) -> Result<WsFrame>
pub fn recv_frame(&mut self) -> Result<WsFrame>
Receive a single raw frame (no reassembly/decompression/control handling) — curl’s raw mode.
Auto Trait Implementations§
impl Freeze for WsReader
impl RefUnwindSafe for WsReader
impl Send for WsReader
impl Sync for WsReader
impl Unpin for WsReader
impl UnsafeUnpin for WsReader
impl UnwindSafe for WsReader
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