Allow for one class to provide both the AutoResource and the ManagedResource.
Allow for one class to provide both the AutoResource and the ManagedResource. See the documentation for ManagedResource for more information.
this object
Function implementing second-level depth of a for-comprehension.
Function implementing second-level depth of a for-comprehension.
Since this is only handling the resource disposal as a side effect,
this is identical to map()
and simply passes through the value
returned by the function f
.
Function implementing no-yield
code handling in a for-comprehension.
Function implementing no-yield
code handling in a for-comprehension.
This simply defers to map()
and discards any value returned.
The actual logic handling code wrapped by resource management, and the function implementing first-level depth of a for-comprehension.
The actual logic handling code wrapped by resource management, and the
function implementing first-level depth of a for-comprehension.
Since this is only handling the resource disposal as a side effect,
the return value is not actually a transformation of T
in the normal
sense. Rather, the return value of the function f
is returned as-is,
and is opaque to the code in map()
.
If the function f
throws an exception, it will propagate up the stack
as normal, but the close()
call will still take place.
After executing the function f
, but before returning its return value,
this calls close()
. If an exception which qualifies as
NonFatal is thrown during the call to close()
, the exception
handler registered with AutoResource.exceptionHandler is called
(it defaults to discarding the exception).
return type of the function f
function (code block) to execute
the value returned by the function f
The backing implementation of a managed resource. For a full explanation of how this is commonly extended, see the ManagedResource documentation.
type of the contained resource