std/resource
Import with import std/resource.
Exports
Section titled “Exports”Interfaces
interface Resource
Section titled “interface Resource”interface Resource { fn close(value: self): Unit }
Protocol for values that release an acquired host or user-space resource when their enclosing block exits.
A resource name = expr statement binds name for the rest of the
current block and calls Resource.close(name) automatically when that
block exits. Cleanup runs in reverse acquisition order.