Skip to main content

Pool

Trait Pool 

Source
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§

Source

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

Source

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

Optional future instant at which the pool should be re-evaluated.

Source

fn members(&self) -> &'static [&'static TaskNode]

Return the pool’s member nodes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§