#[non_exhaustive]pub enum ParseError {
InputTooLarge {
size: usize,
max: usize,
},
InvalidStructure(String),
EmptyInput(String),
MissingQuill(String),
InvalidQuillReference {
value: String,
reason: String,
},
BodyImport(String),
YamlErrorWithLocation {
message: String,
line: usize,
block_index: usize,
hint: Option<String>,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InputTooLarge
InvalidStructure(String)
EmptyInput(String)
Markdown input was empty or whitespace-only.
Emitted as code parse::empty_input so consumers can pattern-match
without inspecting the message text.
MissingQuill(String)
The document is missing its root ~~~ card-yaml block, or that block
does not declare the required $quill system metadata.
Emitted as code parse::missing_quill so consumers can
pattern-match without inspecting the message text.
InvalidQuillReference
A $quill reference failed to parse as a crate::version::QuillReference.
Code parse::invalid_quill_reference; carries
crate::version::quill_ref_hint as its diagnostic hint.
BodyImport(String)
A card body’s markdown could not be imported into the content model:
today only when container nesting exceeds
MAX_NESTING_DEPTH. Code parse::body_import.
YamlErrorWithLocation
Fields
Implementations§
Source§impl ParseError
impl ParseError
Sourcepub fn args(&self) -> BTreeMap<String, Value>
pub fn args(&self) -> BTreeMap<String, Value>
The facts this error’s message interpolates. See Diagnostic::args.
The four String variants contribute no keys, for two different
reasons canon distinguishes: EmptyInput is one fixed sentence, while
InvalidStructure, BodyImport, and MissingQuill carry prose minted
per-site. MissingQuill looks fixed and is not: it picks one of three
sentences by re-reading the source, and no field records which.
pub fn to_diagnostic(&self) -> Diagnostic
Trait Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()