PreferencesSerializer



Proto based serializer for Preferences. Can be used to manually create DataStore using the DataStoreFactory#create function.

Summary

Public functions

open suspend Preferences

Unmarshal object from source.

Cmn
android
N
open suspend Unit

Marshal object to a Sink.

Cmn
android
N

Public properties

open Preferences

Value to return if there is no data on disk.

Cmn
android
N

Public functions

readFrom

open suspend fun readFrom(source: BufferedSource): Preferences

Unmarshal object from source.

Parameters
source: BufferedSource

the BufferedSource with the data to deserialize

writeTo

open suspend fun writeTo(t: Preferences, sink: BufferedSink): Unit

Marshal object to a Sink.

Parameters
t: Preferences

the data to write to output

sink: BufferedSink

the BufferedSink to serialize data to

Public properties

defaultValue

open val defaultValuePreferences

Value to return if there is no data on disk.