Skip to main content

to_osd

Function to_osd 

Source
pub fn to_osd(schema: &Schema, indent: Option<usize>) -> String
Expand description

Serialize a Schema back to OSD text. Ported from Python’s osd.to_osd/_record/_field/_card/_type.

indent: None renders a single-line, machine-oriented form (record definitions and the trailing root statement joined by spaces, fields joined by , , no trailing comma) instead of the default pretty-printed, indented form – mirroring write_oml/write_json’s own indent: None convention. A Some(n) sets the pretty-mode indent width in spaces. Both forms round-trip through parse_schema.