Skip to main content

PanicOnOom

Trait PanicOnOom 

pub trait PanicOnOom {
    type Result;

    // Required method
    fn panic_on_oom(self) -> Self::Result;
}
Expand description

An extension trait for ignoring OutOfMemory errors.

Use this to unwrap a Result<T, OutOfMemory> into its inner T or otherwise panic, leveraging the type system to be sure that you aren’t ever accidentally unwrapping non-OutOfMemory errors.

Required Associated Types§

type Result

The non-OutOfMemory result of calling panic_on_oom.

Required Methods§

fn panic_on_oom(self) -> Self::Result

Panic on OutOfMemory errors, returning the non-OutOfMemory result.

Implementors§

§

impl<T> PanicOnOom for Result<T, OutOfMemory>

§

type Result = T