pub struct BoundServer { /* private fields */ }Expand description
An OssServer with both listeners bound and held live — the eager-bind
half of the serve seam. Returned by OssServer::bind. The gRPC + Flight
SQL surface and the HTTP side-channel are already listening:
Self::flight_addr / Self::health_addr report the ACTUAL bound
addresses (the real ports even when the config requested :0), and neither
port is released before Self::serve_with_shutdown serves on the very same
listeners — there is no release-then-rebind window a concurrent binder could
slip into.
Implementations§
Source§impl BoundServer
impl BoundServer
Sourcepub fn flight_addr(&self) -> SocketAddr
pub fn flight_addr(&self) -> SocketAddr
The ACTUAL address the gRPC + Flight SQL surface is bound to. When the
config requested :0, this is the ephemeral port the kernel assigned —
resolved at OssServer::bind and held.
Sourcepub fn health_addr(&self) -> SocketAddr
pub fn health_addr(&self) -> SocketAddr
The ACTUAL address the HTTP side-channel (/healthz, /readyz,
/metrics) is bound to. When the config requested :0, this is the
ephemeral port the kernel assigned.
Sourcepub async fn serve_with_shutdown(
self,
shutdown: impl Future<Output = ()> + Send + 'static,
) -> Result<(), ServerError>
pub async fn serve_with_shutdown( self, shutdown: impl Future<Output = ()> + Send + 'static, ) -> Result<(), ServerError>
Serve both halves on the already-bound listeners until shutdown
resolves. The HTTP side-channel and the gRPC surface drain in parallel;
the call returns when both have stopped accepting new connections and
finished serving in-flight requests.
Sourcepub async fn serve(self) -> Result<(), ServerError>
pub async fn serve(self) -> Result<(), ServerError>
Serve both halves until SIGINT / SIGTERM arrives. The binary entry
point (OssServer::run and main) reaches graceful shutdown through
this.
Auto Trait Implementations§
impl !Freeze for BoundServer
impl !RefUnwindSafe for BoundServer
impl !UnwindSafe for BoundServer
impl Send for BoundServer
impl Sync for BoundServer
impl Unpin for BoundServer
impl UnsafeUnpin for BoundServer
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.