pub struct ComputeScratch { /* private fields */ }Expand description
A reusable cascade scratch buffer.
Held across many Stylesheet::compute_with calls, it retains its
capacity so the per-compute matching buffer stops allocating once it has
warmed up. It stores rule indices (Vec<usize>), not references, so it
carries no lifetime parameter and can be owned long-term by the caller
without borrowing the stylesheet.
ⓘ
let mut scratch = ComputeScratch::new();
// reuse across the whole draw loop:
for node in &nodes {
let style = sheet.compute_with(node, parent, &mut scratch);
}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ComputeScratch
impl RefUnwindSafe for ComputeScratch
impl Send for ComputeScratch
impl Sync for ComputeScratch
impl Unpin for ComputeScratch
impl UnsafeUnpin for ComputeScratch
impl UnwindSafe for ComputeScratch
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