Closeable


public interface Closeable

Known direct subclasses
ReadScope

The scope used for a read transaction.

StorageConnection

StorageConnection provides a way to read and write a particular type of data.

Known indirect subclasses
WriteScope

The scope used for a write transaction.


Datastore common version of java.io.Closeable

Summary

Public methods

abstract void

Closes the specified resource.

Extension functions

default final @NonNull R
<T extends Closeable, R extends Object> CloseableKt.use(
    @NonNull T receiver,
    @NonNull Function1<@NonNull T, @NonNull R> block
)

Ensures a Closeable object has its close() method called at the end of the supplied block.

Public methods

close

Added in 1.1.0
abstract void close()

Closes the specified resource.

Extension functions

default final @NonNull R <T extends Closeable, R extends Object> CloseableKt.use(
    @NonNull T receiver,
    @NonNull Function1<@NonNull T, @NonNull R> block
)

Ensures a Closeable object has its close() method called at the end of the supplied block.

Throws
Throwable

any exceptions thrown in the block will propagate through this method.