Document

interface Document

Contract for a single serialized document stored as a raw String.

Implementations handle the underlying persistence (e.g. DataStore JSON). The read and write operations are suspending so they can be safely called from any coroutine without blocking the calling thread.

Obtain an instance via Storage.document(...) from the kvs-document artifact.

Functions

Link copied to clipboard
abstract suspend fun read(): String

Reads the current content of the document.

Link copied to clipboard
abstract suspend fun write(value: String)

Overwrites the document with value.