Skip to main content

Policy

Trait Policy 

Source
pub trait Policy: Send + Sync {
    // Required method
    fn decide(
        &self,
        key: Key,
        candidates: &[Candidate],
        budget: (u32, u32),
        limits: &Limits,
    ) -> Decision;
}

Required Methods§

Source

fn decide( &self, key: Key, candidates: &[Candidate], budget: (u32, u32), limits: &Limits, ) -> Decision

candidates is a snapshot; budget is (live, creating) for the key. Called again after a lost race with a fresh snapshot.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§