pub struct OughtMdParser;Expand description
Canonical parser for .ought.md files: CommonMark markdown with bold
deontic keywords (**MUST**, **SHOULD**, …), GIVEN nesting,
OTHERWISE chains, and MUST BY duration literals.
Pure Rust, no LLM dependency.
Trait Implementations§
Source§impl Clone for OughtMdParser
impl Clone for OughtMdParser
Source§fn clone(&self) -> OughtMdParser
fn clone(&self) -> OughtMdParser
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OughtMdParser
impl Debug for OughtMdParser
Source§impl Default for OughtMdParser
impl Default for OughtMdParser
Source§fn default() -> OughtMdParser
fn default() -> OughtMdParser
Returns the “default value” for a type. Read more
Source§impl Parser for OughtMdParser
impl Parser for OughtMdParser
Source§fn parse_string(
&self,
content: &str,
path: &Path,
) -> Result<Spec, Vec<ParseError>>
fn parse_string( &self, content: &str, path: &Path, ) -> Result<Spec, Vec<ParseError>>
Parse a spec from an in-memory string, using
path only as the
source-location label for error messages and source locations.Source§fn name(&self) -> &str
fn name(&self) -> &str
Short, stable name for this parser (e.g.
"ought.md"). Used for
diagnostics and, eventually, format dispatch.Source§fn parse_file(&self, path: &Path) -> Result<Spec, Vec<ParseError>>
fn parse_file(&self, path: &Path) -> Result<Spec, Vec<ParseError>>
Parse a spec file from disk. The default implementation reads the
file and delegates to
Parser::parse_string, so format-specific
parsers usually only need to implement parse_string.impl Copy for OughtMdParser
Auto Trait Implementations§
impl Freeze for OughtMdParser
impl RefUnwindSafe for OughtMdParser
impl Send for OughtMdParser
impl Sync for OughtMdParser
impl Unpin for OughtMdParser
impl UnsafeUnpin for OughtMdParser
impl UnwindSafe for OughtMdParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more