pub struct DnsProxyHandle {
pub shutdown: Arc<AtomicBool>,
pub listen_addr: SocketAddr,
pub thread: Option<JoinHandle<DnsProxyStats>>,
pub upstream_resolver_id: String,
}Expand description
Shutdown coordination handle returned by spawn_proxy_in_netns (Linux)
— held by the supervisor and signalled at cell destroy time.
On non-Linux platforms the supervisor never constructs one of these; the
activation predicate evaluator simply returns None.
Fields§
§shutdown: Arc<AtomicBool>Shared shutdown flag. Setting true signals the proxy loop to exit
at its next iteration (within LISTENER_READ_TIMEOUT worst case).
listen_addr: SocketAddrThe address the proxy listener is bound to inside the cell’s netns.
Used by signal_proxy_shutdown to wake the recv loop.
thread: Option<JoinHandle<DnsProxyStats>>Join handle for the proxy OS thread. Some until join() consumes it.
upstream_resolver_id: StringResolver id stamped into events; retained for diagnostics.
Implementations§
Source§impl DnsProxyHandle
impl DnsProxyHandle
Sourcepub fn join(&mut self) -> Option<DnsProxyStats>
pub fn join(&mut self) -> Option<DnsProxyStats>
Signal the proxy to stop and join the OS thread. Returns the
cumulative DnsProxyStats when the thread exited cleanly, or
None if the thread had already been joined or panicked.
Caller must already have set self.shutdown to true and called
signal_proxy_shutdown (or otherwise woken the recv loop).
Calling this without waking the loop will block for up to
LISTENER_READ_TIMEOUT — bounded but not instant.
Auto Trait Implementations§
impl Freeze for DnsProxyHandle
impl !RefUnwindSafe for DnsProxyHandle
impl Send for DnsProxyHandle
impl Sync for DnsProxyHandle
impl Unpin for DnsProxyHandle
impl UnsafeUnpin for DnsProxyHandle
impl !UnwindSafe for DnsProxyHandle
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> 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