pub trait Pool: Sync {
// Required methods
fn evaluate(&self, now: Instant) -> PoolAction;
fn deferred_until(&self) -> Option<Instant>;
fn members(&self) -> &'static [&'static TaskNode];
}Expand description
Object-safe, synchronous pool interface so &dyn Pool needs no heap: the
policy decides here; the supervisor performs the async start/stop.
Required Methods§
Sourcefn evaluate(&self, now: Instant) -> PoolAction
fn evaluate(&self, now: Instant) -> PoolAction
Run the policy against the current snapshot and report the action to apply. Does not itself start/stop (that’s async — the caller does it).
Sourcefn deferred_until(&self) -> Option<Instant>
fn deferred_until(&self) -> Option<Instant>
Earliest instant this pool must be re-evaluated without a signal.
Sourcefn members(&self) -> &'static [&'static TaskNode]
fn members(&self) -> &'static [&'static TaskNode]
The pool’s member nodes (floor first). Used by the supervisor’s control interface to co-control a whole pool from any member, and by a task-state view to group members. This is the single source of pool membership — the same slice the scaling policy iterates.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".