Skip to main content

Governor

Trait Governor 

Source
pub trait Governor: Send + 'static {
    // Required method
    fn evaluate(&mut self, telemetry: &Telemetry) -> Evaluation;

    // Provided method
    fn watch_interest(&self) -> WatchInterest { ... }
}
Expand description

Trait implemented by specific charging algorithms (e.g. MSC, thermal, battery defender).

Required Methods§

Source

fn evaluate(&mut self, telemetry: &Telemetry) -> Evaluation

Evaluates the latest telemetry snapshot and returns the desired session vote and optional periodic sampling.

May be called more than once per battery-manager update, usually with the same snapshot, so a call is not necessarily a new sample.

Provided Methods§

Source

fn watch_interest(&self) -> WatchInterest

Returns the fields whose changes trigger an evaluation or wake the system. Queried once per session.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§