Function libyml::api::yaml_emitter_set_output_string

source ·
pub unsafe fn yaml_emitter_set_output_string(
    emitter: *mut YamlEmitterT,
    output: *mut u8,
    size: u64,
    size_written: *mut u64,
)
Expand description

Set a string output.

This function sets the output destination for the emitter to a string buffer. The emitter will write the output characters to the output buffer of the specified size. The emitter will set size_written to the number of written bytes. If the buffer is smaller than required, the emitter produces the YAML_write_ERROR error.

§Safety

  • emitter must be a valid, non-null pointer to a properly initialized YamlEmitterT struct.
  • The YamlEmitterT struct must not have an output handler already set.
  • output must be a valid, non-null pointer to a writeable buffer of size size.
  • size_written must be a valid, non-null pointer to a size_t variable.
  • The output buffer must remain valid and unmodified until the emitter is destroyed or the output is reset.
  • The YamlEmitterT struct and its associated data structures must be properly aligned and have the expected memory layout.