pub(crate) struct Router3508 {
pub(crate) fifo: VecDeque<(i32, i32, i32)>,
pub(crate) pkts: HashSet<(i32, i32, i32)>,
pub(crate) dsts: HashMap<i32, BTreeMap<i32, i32>>,
}Expand description
3508m Implement Router
Fields§
§fifo: VecDeque<(i32, i32, i32)>§pkts: HashSet<(i32, i32, i32)>§dsts: HashMap<i32, BTreeMap<i32, i32>>Implementations§
Source§impl Router3508
impl Router3508
Sourcepub(crate) fn new(memory_limit: i32) -> Self
pub(crate) fn new(memory_limit: i32) -> Self
1 <= Src, Dst <= 2*10^5 1 <= T, T_start <= T_end <= 10^9
pub(crate) fn add_packet( &mut self, source: i32, destination: i32, timestamp: i32, ) -> bool
pub(crate) fn forward_packet(&mut self) -> Vec<i32>
pub(crate) fn get_count( &self, destination: i32, start_time: i32, end_time: i32, ) -> i32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Router3508
impl RefUnwindSafe for Router3508
impl Send for Router3508
impl Sync for Router3508
impl Unpin for Router3508
impl UnsafeUnpin for Router3508
impl UnwindSafe for Router3508
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