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.
Object-safe, synchronous pool interface used by the supervisor.
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>
Optional future instant at which the pool should be re-evaluated.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".