pub struct AsyncLoadQueue {
pub pending: BTreeMap<u64, AsyncLoadRequest>,
pub in_flight: HashMap<u64, AsyncLoadRequest>,
pub completed: VecDeque<(u64, bool)>,
pub cancelled: HashSet<u64>,
pub next_id: u64,
pub max_in_flight: usize,
pub max_pending: usize,
}Fields§
§pending: BTreeMap<u64, AsyncLoadRequest>§in_flight: HashMap<u64, AsyncLoadRequest>§completed: VecDeque<(u64, bool)>§cancelled: HashSet<u64>§next_id: u64§max_in_flight: usize§max_pending: usizeImplementations§
Source§impl AsyncLoadQueue
impl AsyncLoadQueue
pub fn new(max_in_flight: usize, max_pending: usize) -> Self
pub fn enqueue( &mut self, coord: ChunkCoord, lod: LodLevel, priority: f32, frame: u64, ) -> u64
pub fn cancel(&mut self, request_id: u64)
pub fn cancel_coord(&mut self, coord: &ChunkCoord)
pub fn dispatch_available(&mut self, frame: u64) -> Vec<AsyncLoadRequest>
pub fn complete_request(&mut self, request_id: u64, success: bool)
pub fn drain_completed(&mut self) -> Vec<(u64, bool)>
pub fn is_pending(&self, coord: &ChunkCoord) -> bool
pub fn is_in_flight(&self, coord: &ChunkCoord) -> bool
pub fn pending_count(&self) -> usize
pub fn in_flight_count(&self) -> usize
pub fn update_priority(&mut self, coord: &ChunkCoord, new_priority: f32)
pub fn stale_requests( &self, current_frame: u64, max_age_frames: u64, ) -> Vec<u64>
Trait Implementations§
Source§impl Clone for AsyncLoadQueue
impl Clone for AsyncLoadQueue
Auto Trait Implementations§
impl Freeze for AsyncLoadQueue
impl RefUnwindSafe for AsyncLoadQueue
impl Send for AsyncLoadQueue
impl Sync for AsyncLoadQueue
impl Unpin for AsyncLoadQueue
impl UnsafeUnpin for AsyncLoadQueue
impl UnwindSafe for AsyncLoadQueue
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.