pub struct RenderCache { /* private fields */ }Expand description
The RenderCache owns all geometry created during the render process.
Implementations§
Source§impl RenderCache
impl RenderCache
Sourcepub fn garbage_collection(&mut self)
pub fn garbage_collection(&mut self)
Remove old items based on a cost function from the cache.
Sourcepub fn get(&mut self, hash: &HashId) -> Option<&GeometryOutput>
pub fn get(&mut self, hash: &HashId) -> Option<&GeometryOutput>
Get geometry output from the cache.
Sourcepub fn insert_with_cost(
&mut self,
hash: impl Into<HashId>,
geo: impl Into<GeometryOutput>,
cost: f64,
) -> GeometryOutput
pub fn insert_with_cost( &mut self, hash: impl Into<HashId>, geo: impl Into<GeometryOutput>, cost: f64, ) -> GeometryOutput
Insert geometry output into the cache with pre-estimated cost and return inserted geometry.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RenderCache
impl RefUnwindSafe for RenderCache
impl !Send for RenderCache
impl !Sync for RenderCache
impl Unpin for RenderCache
impl UnwindSafe for RenderCache
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
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>
Converts
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>
Converts
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