Crate scoped

source ·
Expand description

This crate provides little utilities to declare callbacks inside a scope, that get executed on success, failure, or exit on that scope.

This is different than the ScopeGuard crate does, because here it’s dependent on the scope’s outcome which callbacks should run.

Structs

A guard is a handle to schedule closures on.
A handle is a handle back to a deferred closure. In order to cancel the closure, and get back the value the closure was going to be called with, use Handle::cancel.

Traits

A trait to annotate whether a type is success or failure.

Functions

Executes the scope scope. A scope is a closure, in which access to a guard is granted. A guard is used to schedule callbacks to run on a scope’s success, failure, or exit.

Type Definitions