pub struct PlaceholderGenerator;Expand description
Builds LoadingPlaceholder entries from the current visible tile set.
Stateless – call generate each frame with the
latest visible tiles and a monotonic time value.
Implementations§
Source§impl PlaceholderGenerator
impl PlaceholderGenerator
Sourcepub fn generate(
visible_tiles: &[VisibleTile],
style: &PlaceholderStyle,
time_seconds: f64,
) -> Vec<LoadingPlaceholder>
pub fn generate( visible_tiles: &[VisibleTile], style: &PlaceholderStyle, time_seconds: f64, ) -> Vec<LoadingPlaceholder>
Scan the visible tile set and emit a LoadingPlaceholder for
every tile that has no data.
§Arguments
visible_tiles– The current frame’s visible tile set from the tile manager.style– Active placeholder style (controls animation speed).time_seconds– Monotonic time in seconds (e.g.std::time::Instant::elapsed().as_secs_f64()). Used to compute the shimmer animation phase.
Auto Trait Implementations§
impl Freeze for PlaceholderGenerator
impl RefUnwindSafe for PlaceholderGenerator
impl Send for PlaceholderGenerator
impl Sync for PlaceholderGenerator
impl Unpin for PlaceholderGenerator
impl UnsafeUnpin for PlaceholderGenerator
impl UnwindSafe for PlaceholderGenerator
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