pub struct ListenerHandle { /* private fields */ }Expand description
The write side of one role’s listener: its socket, and its TLS mode.
Held by the reload supervisor and by nothing else. Both sends are
synchronous (watch::Sender::send_replace, and an unbounded
mpsc::Sender::send), which is what lets a socket change sit in the same
uninterruptible publishing run as the routers and the job registry — see
cli::apply_reload.
It deliberately remembers nothing about what it is serving. Whether a
role should rebind is decided by comparing the applied configuration against
the proposed one — never against the address actually bound, since a caller
supplying its own socket (serve_on_with, and every test that binds
127.0.0.1:0) is entitled to one that does not match what the file says.
Implementations§
Source§impl ListenerHandle
impl ListenerHandle
Sourcepub fn serve(&self, listener: TcpListener)
pub fn serve(&self, listener: TcpListener)
Replaces the socket this role serves.
Sourcepub fn set_tls(&self, settings: Option<TlsSettings>)
pub fn set_tls(&self, settings: Option<TlsSettings>)
Publishes the TLS mode the next connection is accepted under. None
is cleartext.
Auto Trait Implementations§
impl Freeze for ListenerHandle
impl RefUnwindSafe for ListenerHandle
impl Send for ListenerHandle
impl Sync for ListenerHandle
impl Unpin for ListenerHandle
impl UnsafeUnpin for ListenerHandle
impl UnwindSafe for ListenerHandle
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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