Function libyml::document::yaml_document_append_mapping_pair
source · pub unsafe fn yaml_document_append_mapping_pair(
document: *mut YamlDocumentT,
mapping: i32,
key: i32,
value: i32,
) -> Success
Expand description
Add a pair of a key and a value to a MAPPING node.
This function adds a key-value pair to the mapping node with the given mapping
id in the
document. The key
and value
arguments are the ids of the nodes to be used as the key and
value, respectively.
§Safety
document
must be a valid, non-null pointer to aYamlDocumentT
struct.mapping
must be a valid index within the range of nodes in theYamlDocumentT
struct, and the node at that index must be aYamlMappingNode
.key
andvalue
must be valid indices within the range of nodes in theYamlDocumentT
struct.- The
YamlDocumentT
struct and its associated nodes must be properly initialized and their memory allocated correctly. - The
YamlDocumentT
struct and its associated nodes must be properly aligned and have the expected memory layout.