pub struct MultipathSender { /* private fields */ }Expand description
Sends packets across multiple paths according to a SchedulingPolicy.
Implementations§
Source§impl MultipathSender
impl MultipathSender
Sourcepub fn new(paths: Vec<PathInfo>, policy: SchedulingPolicy) -> Self
pub fn new(paths: Vec<PathInfo>, policy: SchedulingPolicy) -> Self
Sourcepub fn select_path_index(&mut self, data_len: usize) -> Option<usize>
pub fn select_path_index(&mut self, data_len: usize) -> Option<usize>
Select the best path index for the next packet based on the policy.
Returns None if no active paths are available.
Sourcepub fn select_all_paths(&mut self) -> Vec<usize>
pub fn select_all_paths(&mut self) -> Vec<usize>
For Redundant policy — returns ALL active path indices.
Each path should receive a copy of the packet.
Sourcepub fn path(&self, index: usize) -> Option<&PathInfo>
pub fn path(&self, index: usize) -> Option<&PathInfo>
Get an immutable reference to a path by index.
Sourcepub fn path_mut(&mut self, index: usize) -> Option<&mut PathInfo>
pub fn path_mut(&mut self, index: usize) -> Option<&mut PathInfo>
Get a mutable reference to a path by index.
Sourcepub fn active_path_count(&self) -> usize
pub fn active_path_count(&self) -> usize
Returns the number of active paths.
Sourcepub fn deactivate_path(&mut self, index: usize)
pub fn deactivate_path(&mut self, index: usize)
Mark a path as inactive (e.g. interface went down).
Sourcepub fn activate_path(&mut self, index: usize)
pub fn activate_path(&mut self, index: usize)
Mark a path as active again (e.g. interface came back up).
Sourcepub fn record_loss(&mut self, index: usize)
pub fn record_loss(&mut self, index: usize)
Record a packet loss on a specific path.
Sourcepub fn update_rtt(&mut self, index: usize, rtt: Duration)
pub fn update_rtt(&mut self, index: usize, rtt: Duration)
Update RTT estimate for a specific path.
Sourcepub fn total_scheduled(&self) -> u64
pub fn total_scheduled(&self) -> u64
Total packets scheduled across all paths.
Sourcepub fn set_policy(&mut self, policy: SchedulingPolicy)
pub fn set_policy(&mut self, policy: SchedulingPolicy)
Change the scheduling policy at runtime.
Sourcepub fn policy(&self) -> &SchedulingPolicy
pub fn policy(&self) -> &SchedulingPolicy
Returns the current scheduling policy.
Auto Trait Implementations§
impl Freeze for MultipathSender
impl RefUnwindSafe for MultipathSender
impl Send for MultipathSender
impl Sync for MultipathSender
impl Unpin for MultipathSender
impl UnsafeUnpin for MultipathSender
impl UnwindSafe for MultipathSender
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