pub enum MemoryHeadroom {
Ample,
Tight,
}Expand description
How much memory the host reports it has left.
Variants§
Ample
Enough for what caches and lazy layouts keep ready. A host that reports nothing has it.
Tight
Little: a lazy layout keeps only the items it shows, and its reuse pool one more; caches shrink to their least.
Implementations§
Source§impl MemoryHeadroom
impl MemoryHeadroom
Sourcepub fn of_heap(self, free: usize, total: usize) -> MemoryHeadroom
pub fn of_heap(self, free: usize, total: usize) -> MemoryHeadroom
The headroom of a heap with free of its total bytes left, coming
from self: tight below a quarter free, and ample again only above
three eighths, so the items a tight list lets go do not make it ample
the next frame.
Trait Implementations§
Source§impl Clone for MemoryHeadroom
impl Clone for MemoryHeadroom
Source§fn clone(&self) -> MemoryHeadroom
fn clone(&self) -> MemoryHeadroom
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MemoryHeadroom
Source§impl Debug for MemoryHeadroom
impl Debug for MemoryHeadroom
Source§impl Default for MemoryHeadroom
impl Default for MemoryHeadroom
Source§fn default() -> MemoryHeadroom
fn default() -> MemoryHeadroom
Returns the “default value” for a type. Read more
impl Eq for MemoryHeadroom
Source§impl PartialEq for MemoryHeadroom
impl PartialEq for MemoryHeadroom
impl StructuralPartialEq for MemoryHeadroom
Auto Trait Implementations§
impl Forget for MemoryHeadroom
impl Freeze for MemoryHeadroom
impl Move for MemoryHeadroom
impl RefUnwindSafe for MemoryHeadroom
impl Send for MemoryHeadroom
impl Sync for MemoryHeadroom
impl Unpin for MemoryHeadroom
impl UnsafeUnpin for MemoryHeadroom
impl UnwindSafe for MemoryHeadroom
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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