Struct breaktarget::BreakTarget
[−]
[src]
pub struct BreakTarget<T>(_);
This object represents the target stack frame which we will unwind toward when the break_with method is invoked. The value which we are breaking with will be stored within the BreakTarget to be returned when control flow resumes.
Methods
impl<T> BreakTarget<T>
[src]
fn deploy<F>(func: F) -> T where
F: FnOnce(&BreakTarget<T>) -> T,
F: FnOnce(&BreakTarget<T>) -> T,
Deploy a break target. The target will be passed by reference to the
argument closure. The BreakTarget object provides a single break_with
method, which can be invoked to halt execution and return control to the
deployment site. If the break_with
function was not invoked, the
return value of the closure will instead be produced.
fn break_with(&self, data: T) -> !
Aborts the current function, returning control to the BreakTarget's deploy point. The argument to this method will be the return value of the deploy method.