pub struct CapacityController { /* private fields */ }Expand description
Capacity controller.
Implementations§
Source§impl CapacityController
impl CapacityController
pub fn new(config: CapacityControllerConfig) -> Self
pub fn observe_pre_turn( &mut self, input: CapacityObservationInput, ) -> Option<CapacitySnapshot>
pub fn observe_post_tool( &mut self, input: CapacityObservationInput, ) -> Option<CapacitySnapshot>
Sourcepub fn decide(
&mut self,
turn_index: u64,
snapshot: Option<&CapacitySnapshot>,
) -> CapacityDecision
pub fn decide( &mut self, turn_index: u64, snapshot: Option<&CapacitySnapshot>, ) -> CapacityDecision
Decide intervention from the latest snapshot, with cooldown and safety gates.
pub fn mark_turn_start(&mut self, turn_index: u64)
pub fn mark_intervention_applied( &mut self, turn_index: u64, action: GuardrailAction, )
pub fn mark_replay_failed(&mut self, turn_index: u64)
pub fn last_snapshot(&self) -> Option<&CapacitySnapshot>
Trait Implementations§
Source§impl Clone for CapacityController
impl Clone for CapacityController
Source§fn clone(&self) -> CapacityController
fn clone(&self) -> CapacityController
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CapacityController
impl RefUnwindSafe for CapacityController
impl Send for CapacityController
impl Sync for CapacityController
impl Unpin for CapacityController
impl UnsafeUnpin for CapacityController
impl UnwindSafe for CapacityController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more