[][src]Function dispose::defer_with

pub fn defer_with<W, F: FnOnce(W)>(with: W, f: F) -> Disposable<(W, F)>

Defer an action until the end of a lexical scope, passing the provided argument; similar to defer.

This function is mainly provided for completeness, and is less useful than using FnOnce(W) as DisposeWith<W> for providing a struct with dynamic teardown logic with a provided value.