pub struct Compositor { /* private fields */ }Implementations§
Source§impl Compositor
impl Compositor
pub fn new( policy: TemporalPolicy, atlas_width: usize, atlas_height: usize, ) -> Self
Sourcepub fn begin(
&mut self,
cache: &TileCache,
p: Placement,
frame_width: usize,
frame_height: usize,
) -> Result<(), CompositeError>
pub fn begin( &mut self, cache: &TileCache, p: Placement, frame_width: usize, frame_height: usize, ) -> Result<(), CompositeError>
Plans one placement: its world rect and tile order (resident tiles first, so cold loads only evict the
oldest residents). Tiles stay untouched until the first Compositor::step.
Sourcepub fn cancel(&mut self)
pub fn cancel(&mut self)
Abandons the placement in progress (the host stopped or failed between steps).
Sourcepub fn step(
&mut self,
cache: &mut TileCache,
frame: &Frame<'_>,
now: f64,
) -> Result<Step, CompositeError>
pub fn step( &mut self, cache: &mut TileCache, frame: &Frame<'_>, now: f64, ) -> Result<Step, CompositeError>
Runs the placement until it needs a tile or temporal records, or is done. now is the host’s clock, stamped
on every tile this step writes.
Sourcepub fn load_temporal(
&mut self,
canvas: &str,
records: Vec<TemporalRecord>,
) -> Result<(), CompositeError>
pub fn load_temporal( &mut self, canvas: &str, records: Vec<TemporalRecord>, ) -> Result<(), CompositeError>
Seeds canvas’s temporal index from its stored records (ascending id order) the first time a placement
asks for it; afterwards the index is authoritative.
Sourcepub fn flush(&mut self) -> Vec<TemporalFlush>
pub fn flush(&mut self) -> Vec<TemporalFlush>
Temporal records changed since the last flush, per canvas in first-loaded order.
Sourcepub fn dispose(&mut self)
pub fn dispose(&mut self)
Releases every canvas’s index, keeping what the next Compositor::flush still owes storage. A placement
on a disposed canvas fails with CompositeError::Disposed.
Auto Trait Implementations§
impl Freeze for Compositor
impl RefUnwindSafe for Compositor
impl Send for Compositor
impl Sync for Compositor
impl Unpin for Compositor
impl UnsafeUnpin for Compositor
impl UnwindSafe for Compositor
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more