pub struct Connections { /* private fields */ }Expand description
One live cdn/client/v1 connection per node, shared by every pull of one
command.
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.
One long-lived runtime only (#1675). A connection’s QUIC driver lives on
the runtime that dialled it, and the connection makes progress only while
that driver runs. Share a map only between pulls on one runtime that
outlives the map, such as the decdn CLI’s. A caller that pulls on
runtimes it throws away (decdn-node’s per-serve pull legs) dials per leg
instead, on a long-lived dial runtime
(PeerSource::with_dial_runtime).
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
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