Whether the onExit function has been called
Whether the onExit function has been skipped
Call the onExit function immediately if it has not been called or skipped yet, and prevent it from being called again.
Prevent the onExit function from being called if it has not been called yet
The handle returned from
scopeExitthat allows calling or skipping the providedonExitfunction.Calling
.call()will call the providedonExitfunction immediately, and prevent it from being called again.Calling
.skip()will prevent theonExitfunction from being called.If neither
.call()nor.skip()is called, theonExitfunction will be called automatically when the handle is disposed.