Trait terminate::Terminate[][src]

pub trait Terminate: Send + Sync {
    fn begin_termination(&self);
fn begin_termination_due_to_irrecoverable_error(
        &self,
        irrecoverable_error: &(dyn Any + Send),
        location: Option<&Location<'_>>
    );
fn should_finish(&self) -> bool;
fn terminated_due_to_panic_or_irrecoverable_error(&self) -> bool; fn begin_termination_due_to_panic(&self, panic_info: &PanicInfo<'_>) { ... }
fn should_continue(&self) -> bool { ... } }

Abstracts the need to terminate a loop or application and to begin and check termination.

Required methods

fn begin_termination(&self)[src]

Begin termination.

fn begin_termination_due_to_irrecoverable_error(
    &self,
    irrecoverable_error: &(dyn Any + Send),
    location: Option<&Location<'_>>
)
[src]

Begin termination (due to an irrecoverable error).

Can be called more than once, but should only be called once per thread.

irrecoverable_error is the same type as PanicInfo.payload. location can be None.

fn should_finish(&self) -> bool[src]

Should finish.

fn terminated_due_to_panic_or_irrecoverable_error(&self) -> bool[src]

Check after termination.

Loading content...

Provided methods

fn begin_termination_due_to_panic(&self, panic_info: &PanicInfo<'_>)[src]

Begin termination (due to a panic).

Can be called more than once, but should only be called once per thread.

fn should_continue(&self) -> bool[src]

Should continue (opposite of should_finish()).

Loading content...

Implementors

impl<PPEL: ParsedPanicErrorLogger> Terminate for SimpleTerminate<PPEL>[src]

fn begin_termination(&self)[src]

Begin termination.

Loading content...