frontmatter_gen::parser

Function to_string

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

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

§Arguments

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

§Returns

A Result containing the serialised string or a Error.

§Errors

Returns Error if:

  • Serialisation fails.
  • The specified format is unsupported.