Today, ValueBuilder::[try_]append_variant unconditionally creates and uses a ParentState::Variant, but that is incorrect when the caller is a ListBuilder or ObjectBuilder. We need to rework the API so that the caller passes their parent state.
This is also a building block that will eventually allow VariantArrayBuilder to use a ValueBuilder directly, instead of a VariantBuilder.
Today,
ValueBuilder::[try_]append_variantunconditionally creates and uses aParentState::Variant, but that is incorrect when the caller is aListBuilderorObjectBuilder. We need to rework the API so that the caller passes their parent state.This is also a building block that will eventually allow
VariantArrayBuilderto use aValueBuilderdirectly, instead of aVariantBuilder.