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 initialized YamlParserT struct.
  • event must be a valid, non-null pointer to a YamlEventT struct that can be safely written to.
  • The YamlParserT and YamlEventT 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 to yaml_parser_scan or yaml_parser_load on the same YamlParserT instance.