Function libyml::api::yaml_document_get_node

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

Get a node of a YAML document.

This function returns a pointer to the node at the specified index in the document’s node stack. The pointer returned by this function is valid until any of the functions modifying the document are called.

Returns the node object or NULL if index is out of range.

§Safety

  • document must be a valid, non-null pointer to a YamlDocumentT struct.
  • index must be a valid index within the range of nodes in the 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.