CircuitSaver
Converts Screens and PopResults to and from representations that can be stored in a Compose SaveableStateRegistry.
Circuit's saveable back/nav stack implementations use this to persist navigation state across configuration changes and process death. On Android, Screen and PopResult still require Parcelable in 0.35. CircuitSaver implementations choose the representation that is actually stored; a future release removes the Android Parcelable supertype requirement.
Available strategies include
Android
Parcelable(the Android default)kotlinx-serialization (via the
circuit-serializationartifact)no persistence at all (NoOp).
Returned values must be storable in the platform's SaveableStateRegistry. On Android that means Bundle-supported types like Parcelable or SavedState. Other platforms hold saved state in memory and accept any value, so a saver only matters there if the host app wires its SaveableStateRegistry to durable storage. Apps that do should use a serializing saver like SerializableCircuitSaver so the stored values are actually encodable.
Functions
Returns a saveable representation of value, or null to skip persisting it.