ui

module std::disposesource

Values that must be released by a call, not only freed.

Disposable is a lang item (LANGUAGE_SPEC.md section 6.1a) at the canonical path std::dispose::Disposable. A type declaring it stands for something outside memory, such as a file or a lock: the compiler checks that each of its values is disposed or moved away on every path before its scope ends, and that none is copied (section 5.2). It never calls dispose itself; defer value.dispose(); is the usual way to call it.

interface Disposablesource

exp interface Disposable

Required functions

fn dispose(self: &var);

Implemented by