pub struct ChunkUpdateScheduler {
pub update_queue: VecDeque<(ChunkCoord, u64)>,
pub in_progress: HashSet<ChunkCoord>,
pub completed_this_frame: Vec<ChunkCoord>,
pub max_updates_per_frame: usize,
pub update_interval_frames: u64,
pub next_scheduled_frame: HashMap<ChunkCoord, u64>,
}Fields§
§update_queue: VecDeque<(ChunkCoord, u64)>§in_progress: HashSet<ChunkCoord>§completed_this_frame: Vec<ChunkCoord>§max_updates_per_frame: usize§update_interval_frames: u64§next_scheduled_frame: HashMap<ChunkCoord, u64>Implementations§
Source§impl ChunkUpdateScheduler
impl ChunkUpdateScheduler
pub fn new(max_per_frame: usize, interval: u64) -> Self
pub fn schedule(&mut self, coord: ChunkCoord, current_frame: u64)
pub fn dispatch(&mut self, current_frame: u64) -> Vec<ChunkCoord>
pub fn complete(&mut self, coord: ChunkCoord)
pub fn end_frame(&mut self)
pub fn pending_count(&self) -> usize
pub fn in_progress_count(&self) -> usize
pub fn reschedule_all_loaded( &mut self, loaded: &HashSet<ChunkCoord>, frame: u64, )
Trait Implementations§
Source§impl Clone for ChunkUpdateScheduler
impl Clone for ChunkUpdateScheduler
Auto Trait Implementations§
impl Freeze for ChunkUpdateScheduler
impl RefUnwindSafe for ChunkUpdateScheduler
impl Send for ChunkUpdateScheduler
impl Sync for ChunkUpdateScheduler
impl Unpin for ChunkUpdateScheduler
impl UnsafeUnpin for ChunkUpdateScheduler
impl UnwindSafe for ChunkUpdateScheduler
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.