androidx.savedstate.compose.serialization.serializers

Classes

Top-level functions summary

inline MutableStateSerializer<T>

Creates a KSerializer for a MutableState containing a Serializable value of type T.

Cmn
inline SnapshotStateListSerializer<T>

Creates a KSerializer for a SnapshotStateList containing serializable elements of type T.

Cmn
inline SnapshotStateMapSerializer<K, V>
<K : Any?, V : Any?> SnapshotStateMapSerializer()

Creates a KSerializer for a SnapshotStateMap containing serializable keys of type K and serializable values of type V.

Cmn

Top-level functions

MutableStateSerializer

inline fun <T : Any?> MutableStateSerializer(): MutableStateSerializer<T>

Creates a KSerializer for a MutableState containing a Serializable value of type T.

This inline function infers the state type T automatically and retrieves the appropriate KSerializer for serialization and deserialization of MutableState.

Parameters
<T : Any?>

The type of the value stored in the MutableState.

Returns
MutableStateSerializer<T>

A MutableStateSerializer for handling MutableState containing a Serializable type T.

SnapshotStateListSerializer

inline fun <T : Any?> SnapshotStateListSerializer(): SnapshotStateListSerializer<T>

Creates a KSerializer for a SnapshotStateList containing serializable elements of type T.

This inline function automatically infers the element type T and retrieves the corresponding KSerializer for serializing and deserializing SnapshotStateList instances.

Parameters
<T : Any?>

The type of elements stored in the SnapshotStateList.

Returns
SnapshotStateListSerializer<T>

A SnapshotStateListSerializer for handling serialization and deserialization of a SnapshotStateList containing elements of type T.

SnapshotStateMapSerializer

inline fun <K : Any?, V : Any?> SnapshotStateMapSerializer(): SnapshotStateMapSerializer<K, V>

Creates a KSerializer for a SnapshotStateMap containing serializable keys of type K and serializable values of type V.

This inline function automatically infers the key type K and value type V, and retrieves the corresponding KSerializer for serializing and deserializing SnapshotStateMap instances.

Parameters
<K : Any?>

The type of keys stored in the SnapshotStateMap.

<V : Any?>

The type of values stored in the SnapshotStateMap.

Returns
SnapshotStateMapSerializer<K, V>

A SnapshotStateMapSerializer for handling serialization and deserialization of a SnapshotStateMap containing keys of type K and values of type V.