pub struct AnnounceQueues { /* private fields */ }Expand description
Manage announce queues for all interfaces.
Implementations§
Source§impl AnnounceQueues
impl AnnounceQueues
pub fn new() -> Self
Sourcepub fn gate_announce(
&mut self,
interface: InterfaceId,
raw: Vec<u8>,
dest_hash: [u8; 16],
hops: u8,
emitted: f64,
now: f64,
bitrate: Option<u64>,
announce_cap: f64,
) -> Option<TransportAction>
pub fn gate_announce( &mut self, interface: InterfaceId, raw: Vec<u8>, dest_hash: [u8; 16], hops: u8, emitted: f64, now: f64, bitrate: Option<u64>, announce_cap: f64, ) -> Option<TransportAction>
Try to send an announce on an interface. If bandwidth is available, returns the action immediately. Otherwise, queues it.
Returns Some(action) if the announce should be sent now, None if queued.
Sourcepub fn process_queues(
&mut self,
now: f64,
interfaces: &BTreeMap<InterfaceId, InterfaceInfo>,
) -> Vec<TransportAction>
pub fn process_queues( &mut self, now: f64, interfaces: &BTreeMap<InterfaceId, InterfaceInfo>, ) -> Vec<TransportAction>
Process all announce queues: dequeue and send when bandwidth is available. Called from tick().
Trait Implementations§
Source§impl Clone for AnnounceQueues
impl Clone for AnnounceQueues
Source§fn clone(&self) -> AnnounceQueues
fn clone(&self) -> AnnounceQueues
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 AnnounceQueues
impl RefUnwindSafe for AnnounceQueues
impl Send for AnnounceQueues
impl Sync for AnnounceQueues
impl Unpin for AnnounceQueues
impl UnwindSafe for AnnounceQueues
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