Skip to main content

DaemonHandle

Struct DaemonHandle 

Source
pub struct DaemonHandle {
    pub local_addr: String,
    pub admin_addr: Option<String>,
    pub reload_flag: Arc<AtomicBool>,
    pub healthy: Arc<AtomicBool>,
    pub gateway: Arc<Mutex<Gateway>>,
    /* private fields */
}
Expand description

Daemon handle. On drop, no implicit shutdown — call DaemonHandle::shutdown explicitly (mirrors every other zerodds-*-bridged daemon).

Fields§

§local_addr: String

Bound HTTP address (may differ from the configured listen if port 0 was asked for).

§admin_addr: Option<String>

Bound admin (/metrics) address, if metrics.enabled.

§reload_flag: Arc<AtomicBool>

SIGHUP sets this.

§healthy: Arc<AtomicBool>

true once the listener is up.

§gateway: Arc<Mutex<Gateway>>

The shared gateway — exported for tests that want to inspect or drive it directly without going through HTTP.

Implementations§

Source§

impl DaemonHandle

Source

pub fn stop_requested(&self) -> bool

Whether SIGTERM/SIGINT (or Self::shutdown) asked the daemon to stop.

Source

pub fn shutdown(&mut self)

Initiates a graceful shutdown: stops accepting new connections and joins the accept thread. Open connections are not force- closed — they finish their current request/response and then see stop on their next keep-alive iteration.

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.