frontmatter_gen::parser

Function to_string

Source
pub fn to_string(
    frontmatter: &Frontmatter,
    format: Format,
) -> Result<String, FrontmatterError>
Expand description

Converts a Frontmatter object to a string representation in the specified format.

Performs optimised serialisation with pre-allocated buffers where possible.

§Arguments

  • frontmatter - Reference to the Frontmatter object to serialise
  • format - The target format for serialisation

§Returns

A Result containing the serialised string or a FrontmatterError