pub struct WsFramedStream { /* private fields */ }Expand description
A WebSocket-backed FramedStream.
Uses split read/write halves to avoid mutex contention between the heartbeat task and the main send/recv path:
- Write half (
SplitSink): Shared viaArc<Mutex<_>>betweensend()and the heartbeat task (which sends Ping frames). - Read half (
SplitStream): Owned exclusively byrecv()— no mutex needed. - Heartbeat: Sends Ping on the write half at
ping_interval. Tracks last Pong viaArc<AtomicU64>(epoch millis). Iflast_pongexceedspong_timeout, the connection is closed.
Implementations§
Source§impl WsFramedStream
impl WsFramedStream
Sourcepub fn remote_peer_id(&self) -> &str
pub fn remote_peer_id(&self) -> &str
Get the remote peer’s Tailscale stable ID (from the hello envelope).
This is the session layer’s routing key. For the application-visible
device identifier, use remote_identity().device_id.
Sourcepub fn remote_identity(&self) -> Option<&PeerIdentity>
pub fn remote_identity(&self) -> Option<&PeerIdentity>
Get the full remote PeerIdentity advertised in the hello envelope.
Returns None only in test fixtures that synthesise a stream without
running the hello exchange — production streams always have this.
Trait Implementations§
Source§impl Debug for WsFramedStream
impl Debug for WsFramedStream
Source§impl Drop for WsFramedStream
impl Drop for WsFramedStream
Source§impl FramedStream for WsFramedStream
impl FramedStream for WsFramedStream
impl Sync for WsFramedStream
Auto Trait Implementations§
impl !RefUnwindSafe for WsFramedStream
impl !UnwindSafe for WsFramedStream
impl Freeze for WsFramedStream
impl Send for WsFramedStream
impl Unpin for WsFramedStream
impl UnsafeUnpin for WsFramedStream
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