pub struct Scene3DOutputCache<T> { /* private fields */ }Expand description
The outputs of the scenes a backend drew recently, with the rasterizer that makes them.
Implementations§
Source§impl<T: Clone> Scene3DOutputCache<T>
impl<T: Clone> Scene3DOutputCache<T>
Sourcepub const DEFAULT_CAPACITY: usize = 8
pub const DEFAULT_CAPACITY: usize = 8
The number of outputs a cache keeps by default: the viewports of a window or two.
Sourcepub fn new() -> Self
pub fn new() -> Self
An empty cache of DEFAULT_CAPACITY outputs.
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
An empty cache of capacity outputs (at least one).
Sourcepub fn get_or_render(
&mut self,
scene: &Arc<Scene3DSnapshot>,
size: PixelSize,
scale: f64,
options: CpuRenderOptions,
make: impl FnOnce(Scene3DImage) -> Option<T>,
) -> Option<T>
pub fn get_or_render( &mut self, scene: &Arc<Scene3DSnapshot>, size: PixelSize, scale: f64, options: CpuRenderOptions, make: impl FnOnce(Scene3DImage) -> Option<T>, ) -> Option<T>
The output of scene at size pixels, scale and options: the kept one when the
snapshot, its generations, the size, the scale and the options are those it was made for;
otherwise the scene is rasterized and make turns the image into the backend’s form
(None when it cannot, which keeps nothing). A new output of a scene replaces the older
one of the same scene, and the least recently used output makes room for a new one.
Trait Implementations§
Auto Trait Implementations§
impl<T> Forget for Scene3DOutputCache<T>
impl<T> Freeze for Scene3DOutputCache<T>
impl<T> Move for Scene3DOutputCache<T>
impl<T> RefUnwindSafe for Scene3DOutputCache<T>where
Vec<OutputEntry<T>>: RefUnwindSafe,
impl<T> Send for Scene3DOutputCache<T>
impl<T> Sync for Scene3DOutputCache<T>
impl<T> Unpin for Scene3DOutputCache<T>
impl<T> UnsafeUnpin for Scene3DOutputCache<T>where
Vec<OutputEntry<T>>: UnsafeUnpin,
impl<T> UnwindSafe for Scene3DOutputCache<T>where
Vec<OutputEntry<T>>: UnwindSafe,
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more