Companion

object Companion

Functions

Link copied to clipboard
fun <A> defer(f: suspend () -> Resource<A>): Resource<A>
Link copied to clipboard
operator fun <A> invoke(acquire: suspend () -> A, release: suspend (A, ExitCase) -> Unit): Resource<A>

Construct a Resource from an allocating function acquire and a release function release.

Link copied to clipboard
fun <A> just(r: A): Resource<A>

Create a Resource from a pure value A.

Extensions

Link copied to clipboard
fun <A : AutoCloseable> Resource.Companion.fromAutoCloseable(f: suspend () -> A): Resource<A>
Link copied to clipboard
fun <A : Closeable> Resource.Companion.fromCloseable(f: suspend () -> A): Resource<A>
Link copied to clipboard
Link copied to clipboard