Function libyml::api::yaml_document_get_root_node

source ·
pub unsafe fn yaml_document_get_root_node(
    document: *mut YamlDocumentT,
) -> *mut YamlNodeT
Expand description

Get the root of a YAML document node.

This function returns a pointer to the root node of the YAML document. The root object is the first object added to the document.

The pointer returned by this function is valid until any of the functions modifying the document are called.

An empty document produced by the parser signifies the end of a YAML stream.

Returns the node object or NULL if the document is empty.

§Safety

  • document must be a valid, non-null pointer to a YamlDocumentT 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.
  • The caller must not modify or free the returned pointer, as it is owned by the YamlDocumentT struct.