-
- All Implemented Interfaces:
public final class AutoCloseKt
-
-
Method Summary
Modifier and Type Method Description final static <R extends Any, T extends BaseCoAcceptor<R>> Ruse(T $self, SuspendFunction1<T, Unit> block)Use an acceptor and auto-close it on completion. -
-
Method Detail
-
use
final static <R extends Any, T extends BaseCoAcceptor<R>> R use(T $self, SuspendFunction1<T, Unit> block)
Use an acceptor and auto-close it on completion. Unlike the similar function for AutoCloseable, this function returns the
resultof the acceptor, not the return value of the block.- Parameters:
block- a lambda to be executed with the acceptor as a parameter
-
-
-
-