Skip to main content

BoundServer

Struct BoundServer 

Source
pub struct BoundServer { /* private fields */ }
Expand description

A bound, running listener.

Implementations§

Source§

impl BoundServer

Source

pub fn local_addr(&self) -> SocketAddr

The address actually bound, with the kernel’s choice of port filled in.

Source

pub fn admission(&self) -> AdmissionStats

What the admission gate has done since this listener started.

This is the visibility half of the fix. A limit whose saturation cannot be read is the same undiagnosable “git is slow” the accidental 512-thread ceiling produced; admitted, refused_* and peak_in_flight are what an operator, or a test, looks at instead.

Source

pub fn admission_gate(&self) -> Arc<Admission> ⓘ

The admission gate itself, so a second transport can route through the SAME one (one implementation).

gunnar-http is a second front door onto the same server, and a git transfer over HTTP has to count against the same server-wide and per-principal ceilings — and the same memory budget — as one over SSH, or an appliance’s real concurrency is silently twice the number written on the box. Handing out the Arc (rather than rebuilding a gate from the same numbers) is what makes it one gate with one set of counters, not two that happen to agree: on 2026-08-31 the HTTP front was found with no gate at all, and two gates would have been the next-worst answer.

Source

pub fn metrics(&self) -> MetricsSnapshot

The server-wide counters.

Source

pub fn metrics_handle(&self) -> &Arc<ServerMetrics> ⓘ

The counter block itself, for a caller that wants to keep reading it after this listener is consumed by BoundServer::shutdown.

Source

pub async fn shutdown(self, reason: &str) -> Result<()>

Ask every session to disconnect, then wait for the accept loop to stop — for at most SSH_SHUTDOWN_GRACE.

Bounded, the way the gRPC half already is (GRPC_SHUTDOWN_GRACE in gunnar-server): the accept loop only ends when its sessions do, and a session whose peer never answers the disconnect — MEASURED 2026-09-28 on loki, a primary’s replication session into a standby being stopped, 1 run in 17 under a parallel test binary — held shutdown for an hour. A shutdown that can hang forever is a restart, a drain or a growth that can hang forever. Past the grace the listener task is aborted and the reason is logged; the sessions go with the process.

Source

pub async fn shutdown_within(self, reason: &str, grace: Duration) -> Result<()>

Self::shutdown with an explicit grace (tests use a short one).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more