diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,4 @@ +#![doc = include_str!("../README.md")] #![warn(clippy::pedantic, clippy::cargo)] #[cfg(feature = "parse-knuffel")] @@ -17,6 +18,15 @@ pub struct Schema { pub document: Document, } +#[cfg(feature = "parse-knuffel")] +impl Schema { + pub fn parse( + schema_kdl: &str, + ) -> Result<Self, knuffel::Error<impl knuffel::traits::ErrorSpan>> { + knuffel::parse("<Schema::parse argument>", schema_kdl) + } +} + #[derive(Debug, PartialEq, Eq, Default)] #[cfg_attr(feature = "parse-knuffel", derive(Decode))] pub struct Document { |