pub struct WindowState {
pub window: usize,
pub window_max: usize,
pub window_min: usize,
pub window_flexibility: usize,
pub fast_rate_rounds: usize,
pub very_slow_rate_rounds: usize,
}Expand description
Window adaptation state for resource transfers.
Tracks window size, min/max bounds, and rate detection for fast/very-slow link adaptation.
Fields§
§window: usize§window_max: usize§window_min: usize§window_flexibility: usize§fast_rate_rounds: usize§very_slow_rate_rounds: usizeImplementations§
Source§impl WindowState
impl WindowState
pub fn new() -> Self
Sourcepub fn restore(&mut self, previous_window: usize)
pub fn restore(&mut self, previous_window: usize)
Restore window state from a previous transfer on the same link.
Sourcepub fn on_window_complete(&mut self)
pub fn on_window_complete(&mut self)
Called when all outstanding parts in the window are received. Grows window and ratchets window_min.
Sourcepub fn on_timeout(&mut self)
pub fn on_timeout(&mut self)
Called on timeout waiting for parts. Shrinks window, shrinks window_max (can decrease by 2).
Sourcepub fn update_req_resp_rate(&mut self, rate: f64)
pub fn update_req_resp_rate(&mut self, rate: f64)
Update rate tracking based on measured req_resp_rtt_rate. Called after first part of a window is received.
Sourcepub fn update_data_rate(&mut self, rate: f64)
pub fn update_data_rate(&mut self, rate: f64)
Update rate tracking based on measured data RTT rate. Called after a full window of parts is received.
Trait Implementations§
Source§impl Clone for WindowState
impl Clone for WindowState
Source§fn clone(&self) -> WindowState
fn clone(&self) -> WindowState
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 moreAuto Trait Implementations§
impl Freeze for WindowState
impl RefUnwindSafe for WindowState
impl Send for WindowState
impl Sync for WindowState
impl Unpin for WindowState
impl UnwindSafe for WindowState
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