Skip to main content

ControlLine

Trait ControlLine 

Source
pub trait ControlLine:
    Send
    + Sync
    + 'static {
    // Required methods
    fn epoch(&self) -> u64;
    fn state(&self) -> ControlState;
    fn deadline(&self) -> Option<Instant>;
}
Expand description

A process-wide signal (shed, lockdown, drain, stop) that net-io’s workers read at the top of each loop, before each accept batch, and before each admission.

The epoch changes on every state change; the state is read only when it moved.

Required Methods§

Source

fn epoch(&self) -> u64

The current epoch (an Acquire load).

Source

fn state(&self) -> ControlState

The current state; read only when the epoch moved.

Source

fn deadline(&self) -> Option<Instant>

The deadline for Draining, if the line carries one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§