encodeToElement

fun <T> encodeToElement(serializer: KSerializer<T>, item: T): GenericElement(source)

Encodes the provided item into a GenericElement using the specified serializer.

Report a problem

Return

A GenericElement representing the encoded data of the item.

Parameters

serializer

The serializer to be used for encoding the item.

item

The item to encode into a GenericElement.