pub struct MemoryBudget { /* private fields */ }Implementations§
Source§impl MemoryBudget
impl MemoryBudget
pub fn new(ceiling: u64) -> MemoryBudget
Sourcepub fn admit(
&self,
bytes: u64,
alone: bool,
stop: impl Fn() -> bool,
) -> Option<Permit<'_>>
pub fn admit( &self, bytes: u64, alone: bool, stop: impl Fn() -> bool, ) -> Option<Permit<'_>>
Wait for room for bytes; alone holds the device exclusively (the retry of a
render that ran out of memory). None when stop turns true while waiting (the process is
ending): the caller renders on the CPU.
Sourcepub fn out_of_memory(&self)
pub fn out_of_memory(&self)
A render ran out of device memory: halve the budget (not below what one render needs).
Auto Trait Implementations§
impl !Freeze for MemoryBudget
impl Forget for MemoryBudget
impl RefUnwindSafe for MemoryBudget
impl Send for MemoryBudget
impl Sync for MemoryBudget
impl Unpin for MemoryBudget
impl UnsafeUnpin for MemoryBudget
impl UnwindSafe for MemoryBudget
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