pub struct PropagationScheduler { /* private fields */ }Expand description
Propagation scheduler
Implementations§
Source§impl PropagationScheduler
impl PropagationScheduler
Sourcepub fn new(interests: InterestMap, topology: PropagationTopology) -> Self
pub fn new(interests: InterestMap, topology: PropagationTopology) -> Self
Create a new scheduler
Sourcepub fn set_bandwidth_budget(&mut self, bytes_per_second: u32)
pub fn set_bandwidth_budget(&mut self, bytes_per_second: u32)
Set bandwidth budget
Sourcepub fn schedule(&self, update: &StateUpdate) -> Vec<PropagationDecision>
pub fn schedule(&self, update: &StateUpdate) -> Vec<PropagationDecision>
Decide how to propagate an update
Sourcepub fn record_send(&mut self, target: NodeId, bytes: u32)
pub fn record_send(&mut self, target: NodeId, bytes: u32)
Update bandwidth usage
Sourcepub fn reset_bandwidth(&mut self)
pub fn reset_bandwidth(&mut self)
Reset bandwidth usage (call periodically)
Sourcepub fn has_bandwidth(&self, target: NodeId, bytes: u32) -> bool
pub fn has_bandwidth(&self, target: NodeId, bytes: u32) -> bool
Check if we have bandwidth for a send
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PropagationScheduler
impl RefUnwindSafe for PropagationScheduler
impl Send for PropagationScheduler
impl Sync for PropagationScheduler
impl Unpin for PropagationScheduler
impl UnsafeUnpin for PropagationScheduler
impl UnwindSafe for PropagationScheduler
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