Skip to main content

parse_doc

Function parse_doc 

Source
pub fn parse_doc(doc: &KdlDocument) -> Result<Schema, ParseError>
Expand description

Parse an already-loaded kdl::KdlDocument into a Schema.

The intended caller is parse_path, which composes a multi-file schema via kdl_compose::compose and then hands the resolved document to this entry; exposed publicly so library consumers who build a KdlDocument some other way (custom IO, in-memory generation) can skip the string round trip.

§Errors

Same shape as parseParseError::Kdl on a deserialization failure, ParseError::Validation on a schema-rule violation.