createSerializable

inline fun <T> createSerializable(noinline encodeToString: (T) -> String, noinline decodeFromString: (String) -> T): Serializable<T>

Creates a new Serializable instance for the given type with the provided serialization and deserialization functions.

This inline function avoids unnecessary function call overhead and offers a concise way to create Serializable instances.

Return

A new Serializable instance for the given type.

Parameters

T

The type of object this Serializable instance handles.

encodeToString

A function that converts an object of type T to a string representation.

decodeFromString

A function that converts a string representation back to an object of type T.