ManagedResource<T> class
Resource wrapper that ensures proper cleanup using try-finally pattern
Constructors
- ManagedResource(T resource, void _cleanup(T))
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
no setter
- resource → T
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void - Manually dispose the resource
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
use<
R> (R action(T)) → R - Use the resource with automatic cleanup
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited