Skip to main content

SurbBalancerController

Trait SurbBalancerController 

Source
pub trait SurbBalancerController {
    // Required methods
    fn bounds(&self) -> BalancerControllerBounds;
    fn set_target_and_limit(&mut self, bounds: BalancerControllerBounds);
    fn next_control_output(&mut self, current_buffer_level: u64) -> u64;
    fn reset(&mut self);
}
Expand description

Trait abstracting a controller used in the SurbBalancer.

Required Methods§

Source

fn bounds(&self) -> BalancerControllerBounds

Gets the current bounds of the controller.

Source

fn set_target_and_limit(&mut self, bounds: BalancerControllerBounds)

Updates the controller’s target (setpoint) and output limit.

Source

fn next_control_output(&mut self, current_buffer_level: u64) -> u64

Queries the controller for the next control output based on the current_buffer_level of SURBs.

Source

fn reset(&mut self)

Discards accumulated history, leaving the bounds intact.

Used when the buffer estimate the controller has been acting on stops meaning what it meant – crossing into or out of a period where the counterparty could not be observed at all. Carrying the error accumulated under the old regime into the new one makes the controller answer a question nobody asked.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§