pub struct StartupSignal { /* private fields */ }Expand description
Shared handle used by a Consumer to signal readiness (or failure) to the
runtime’s StartupReceiver.
Constructed in a pair via StartupSignal::pair. The signal is held by
the consumer side (via ConsumerContext); the receiver is returned to
the route controller.
Implementations§
Source§impl StartupSignal
impl StartupSignal
Sourcepub fn pair() -> (Self, StartupReceiver)
pub fn pair() -> (Self, StartupReceiver)
Create a (signal, receiver) pair seeded in the Pending state.
Sourcepub fn mark_ready(&self) -> bool
pub fn mark_ready(&self) -> bool
Mark the consumer as ready. Idempotent — subsequent calls are no-ops
once the state has transitioned out of Pending.
Returns true if this call transitioned Pending → Ready, false
if the state was already Ready or Failed. The runtime uses the
return value to detect Explicit consumers that returned Ok from
start() without calling mark_ready (a contract violation that
would hang the controller without the defensive fallback in
spawn_consumer_task).
Sourcepub fn mark_failed(&self, err: String)
pub fn mark_failed(&self, err: String)
Mark the consumer’s startup as failed with err. Idempotent.
Trait Implementations§
Source§impl Clone for StartupSignal
impl Clone for StartupSignal
Source§fn clone(&self) -> StartupSignal
fn clone(&self) -> StartupSignal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more