ixa

Module plan

Source
Expand description

A priority queue that stores arbitrary data sorted by time and priority

Defines a Queue<T, P> that is intended to store a queue of items of type T - sorted by f64 time and definable priority P - called ‘plans’. This queue has methods for adding plans, cancelling plans, and retrieving the earliest plan in the queue. Adding a plan is O(log(n)) while cancellation and retrieval are O(1).

This queue is used by Context to store future events where some callback closure FnOnce(&mut Context) will be executed at a given point in time.

Structs§

  • A plan that holds data of type T intended to be used at the specified time
  • A unique identifier for a plan added to a Queue<T>
  • A time, id, and priority object used to order plans in the Queue<T>
  • A priority queue that stores arbitrary data sorted by time