save

abstract suspend fun <R : Data> save(unit: StorageUnit<R>): R?

Save the cached data represented by the given storage unit to persistent storage, creating any files and folders as needed.

Return

The saved data if it was found, null otherwise.


abstract suspend fun <R : Data> save(unit: StorageUnit<R>, data: R): R

Save the given data represented by the given storage unit to persistent storage, creating any files and folders as needed, and storing the given data object in the dataCache.

Return

The saved data.