pub struct FlowControlPolicy {
pub config: FlowControlConfig,
}Expand description
Deterministic policy evaluator for websocket remote flow control.
Fields§
§config: FlowControlConfigRuntime policy configuration.
Implementations§
Source§impl FlowControlPolicy
impl FlowControlPolicy
Sourcepub const fn new(config: FlowControlConfig) -> Self
pub const fn new(config: FlowControlConfig) -> Self
Construct a policy with explicit configuration.
Sourcepub fn evaluate(self, snapshot: FlowControlSnapshot) -> FlowControlDecision
pub fn evaluate(self, snapshot: FlowControlSnapshot) -> FlowControlDecision
Evaluate one deterministic backpressure decision.
Sourcepub fn should_replenish(
self,
consumed_bytes: u32,
window_bytes: u32,
elapsed_ms: u64,
) -> bool
pub fn should_replenish( self, consumed_bytes: u32, window_bytes: u32, elapsed_ms: u64, ) -> bool
Replenish flow-control window at 50% consumption or interval timeout.
Sourcepub fn should_drop_input_event(
self,
queue_bytes: u32,
class: InputEventClass,
) -> bool
pub fn should_drop_input_event( self, queue_bytes: u32, class: InputEventClass, ) -> bool
Non-negotiable input drop rule: only non-interactive events are droppable.
Trait Implementations§
Source§impl Clone for FlowControlPolicy
impl Clone for FlowControlPolicy
Source§fn clone(&self) -> FlowControlPolicy
fn clone(&self) -> FlowControlPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FlowControlPolicy
impl Debug for FlowControlPolicy
Source§impl Default for FlowControlPolicy
impl Default for FlowControlPolicy
Source§impl PartialEq for FlowControlPolicy
impl PartialEq for FlowControlPolicy
impl Copy for FlowControlPolicy
impl StructuralPartialEq for FlowControlPolicy
Auto Trait Implementations§
impl Freeze for FlowControlPolicy
impl RefUnwindSafe for FlowControlPolicy
impl Send for FlowControlPolicy
impl Sync for FlowControlPolicy
impl Unpin for FlowControlPolicy
impl UnwindSafe for FlowControlPolicy
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