DataStoreStorage

inline fun <T : @Serializable Any> DataStoreStorage(dataStore: DataStore<T?>, cacheStrategy: CacheStrategy = CacheStrategy.NO_CACHE, file: File? = null): Storage<T>(source)

Creates a new Storage instance for storing serializable objects in DataStore.

Return

A new Storage instance.

Parameters

dataStore

The DataStore instance to use for storing the object.

cacheStrategy

Cache strategy to use for caching the item in memory.

Type Parameters

T

The type of the object to be stored. Must be serializable.