Trait talc::OomHandler
source · pub trait OomHandler: Sized {
// Required method
fn handle_oom(talc: &mut Talc<Self>, layout: Layout) -> Result<(), ()>;
}
Required Methods§
sourcefn handle_oom(talc: &mut Talc<Self>, layout: Layout) -> Result<(), ()>
fn handle_oom(talc: &mut Talc<Self>, layout: Layout) -> Result<(), ()>
Given the allocator and the layout
of the allocation that caused
OOM, resize or claim and return Ok(())
or fail by returning Err(())
.
This function is called repeatedly if the allocator is still out of memory.
Therefore an infinite loop will occur if Ok(())
is repeatedly returned
without extending or claiming new memory.
Object Safety§
This trait is not object safe.