Function libyml::yaml_parser_parse
source · pub unsafe fn yaml_parser_parse(
parser: *mut YamlParserT,
event: *mut YamlEventT,
) -> Success
Expand description
Parse the input stream and produce the next parsing event.
Call the function subsequently to produce a sequence of events corresponding to the input stream. The initial event has the type YamlStreamStartEvent while the ending event has the type YamlStreamEndEvent.
An application is responsible for freeing any buffers associated with the produced event object using the yaml_event_delete() function.
An application must not alternate the calls of yaml_parser_parse() with the calls of yaml_parser_scan() or yaml_parser_load(). Doing this will break the parser.
§Safety
parser
must be a valid, non-null pointer to a properly initializedYamlParserT
struct.event
must be a valid, non-null pointer to aYamlEventT
struct that can be safely written to.- The
YamlParserT
andYamlEventT
structs must be properly aligned and have the expected memory layout. - The caller must call
yaml_event_delete
to free any buffers associated with the produced event object. - The caller must not alternate calls to
yaml_parser_parse
with calls toyaml_parser_scan
oryaml_parser_load
on the sameYamlParserT
instance.