toEngineGraph

fun <V> toEngineGraph(value: Any?, scalar: (Any?) -> V, array: () -> V, obj: () -> V, append: (V, V) -> Unit, put: (V, String, V) -> Unit, bytes: (ByteArray) -> V): V(source)

Builds a graph without recursive host calls. array and obj allocate empty destinations; append and put fill them without consuming the child values. Collections and custom objects converted to collections retain their identity within this call. The caller owns the engine values the callbacks allocate and must clean up temporaries, including on error.