pub struct Connections { /* private fields */ }Expand description
One live connection per node on one ALPN, shared by every pull of one
command (cdn/client/v1, from new) or by every outbound
call of one node (with_options).
A pull opens its own bi-stream on the node’s connection and dials only when
the node has no live connection. Concurrent callers for one node share one
dial. A pull that meets a transport fault (a connection reset, a closed
connection, an idle timeout, an open or read that falls under its
deadline) unpins its connection (invalidate), so the
next get dials again. A protocol refusal or a hash mismatch
ends only its own stream, and the connection stays pinned. The connection
carries no payment state: payment lanes stay per (signer, provider).
Cloning is cheap: every clone shares one map. Each pull holds its connection, so each connection closes when the map drops it and no pull still holds it.
Where the drivers run (#1675). A connection’s QUIC driver lives on the
runtime that dialled it, and the connection makes progress only while that
driver runs. A map with a dial runtime dials every connection there, so
callers on any runtime share it, including runtimes they throw away
(decdn-node’s per-serve pull legs), as long as the dial runtime outlives
the endpoint. A map without one dials on the caller’s runtime: share it
only between callers on one runtime that outlives the map, such as the
decdn CLI’s.
Implementations§
Trait Implementations§
Source§impl Clone for Connections
impl Clone for Connections
Auto Trait Implementations§
impl !RefUnwindSafe for Connections
impl !UnwindSafe for Connections
impl Freeze for Connections
impl Send for Connections
impl Sync for Connections
impl Unpin for Connections
impl UnsafeUnpin for Connections
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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