pub struct DestTransport { /* private fields */ }Expand description
DestTransport - Transport layer manager for a single destination
Core responsibilities:
- Manage all connections to a specific Dest (WebSocket + WebRTC)
- Concurrently establish connections in background (saturated connection pattern)
- Event-driven wait for connection status
- Cache Lanes within WireHandle
- WirePool handles priority selection
Implementations§
Source§impl DestTransport
impl DestTransport
Sourcepub async fn new(
dest: Dest,
connections: Vec<WireHandle>,
) -> NetworkResult<Self>
pub async fn new( dest: Dest, connections: Vec<WireHandle>, ) -> NetworkResult<Self>
Create new DestTransport
§Arguments
dest: destinationconnections: list of pre-built connections (WebSocket/WebRTC)
Sourcepub async fn send(
&self,
payload_type: PayloadType,
data: &[u8],
) -> NetworkResult<()>
pub async fn send( &self, payload_type: PayloadType, data: &[u8], ) -> NetworkResult<()>
Send message
Core design: event-driven waiting
- If connection available, send immediately
- If not, wait for connection status change (via watch channel)
- WirePool already handles priority, only need to try DataLane Types in order
Sourcepub async fn retry_failed_connections(
&self,
dest: &Dest,
wire_builder: &dyn WireBuilder,
) -> NetworkResult<()>
pub async fn retry_failed_connections( &self, dest: &Dest, wire_builder: &dyn WireBuilder, ) -> NetworkResult<()>
Retry failed connections (smart reconnect)
§Behavior
- Calls WireBuilder to create new connections
- Uses
add_connection_smart()to skip already-working connections - Perfect for reconnection after detecting connection failures
§Arguments
dest: destination (used by WireBuilder)wire_builder: factory to create new WireHandles
Sourcepub async fn close(&self) -> NetworkResult<()>
pub async fn close(&self) -> NetworkResult<()>
Close DestTransport and release all connection resources
Sourcepub async fn has_healthy_connection(&self) -> bool
pub async fn has_healthy_connection(&self) -> bool
Check if any connection is still healthy
Used by health checker to detect failed connections
§Returns
true: at least one connection is healthy (connected)false: all connections are unhealthy or no connections exist
Sourcepub fn watch_ready(&self) -> Receiver<HashSet<ConnType>>
pub fn watch_ready(&self) -> Receiver<HashSet<ConnType>>
Subscribe to ready-set changes (used for manager-side cleanup).
Auto Trait Implementations§
impl Freeze for DestTransport
impl !RefUnwindSafe for DestTransport
impl Send for DestTransport
impl Sync for DestTransport
impl Unpin for DestTransport
impl !UnwindSafe for DestTransport
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more