Skip to main content

to_gram_with_header

Function to_gram_with_header 

Source
pub fn to_gram_with_header(
    header: Record,
    patterns: &[Pattern<Subject>],
) -> Result<String, SerializeError>
Expand description

Serializes patterns with a leading header record.

Emits the header as a top-level record followed by the patterns, joined by newlines.

§Arguments

  • header - Header record to serialize
  • patterns - Patterns to serialize

§Returns

  • Ok(String) - Valid Gram notation with header