#[non_exhaustive]pub enum ParseError {
NoIdentifier {
entry_key: Option<String>,
},
UnsupportedIdentifier {
kind: &'static str,
value: String,
entry_key: Option<String>,
},
SoftwareUrl {
url: String,
entry_key: Option<String>,
},
InvalidRef {
raw: String,
entry_key: Option<String>,
source: RefParseError,
},
Decode {
format: &'static str,
message: String,
},
UnsupportedFormat {
format: &'static str,
},
}Expand description
Why a single bibliography entry failed to produce a Ref.
Closed-enum so the failure-class can be exposed at the
docs/ERRORS.md §3 INVALID_REF surface without leaking parser
internals.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoIdentifier
The line did not contain a doi: / arxiv: / bare-DOI /
bare-arXiv id — empty (after trimming) or just a comment.
Plain-refs path filters these out silently; CSL-JSON path
emits this when an entry has no resolvable identifier.
UnsupportedIdentifier
The entry DOES carry an identifier, and it is one doiget recognises
and resolves only with a request: a PMID / PMCID, through the DOI
PubMed lists for it (#500, crate::pubmed::resolve_entries).
Distinct from Self::NoIdentifier because the two send a reader in
opposite directions. “entry has no DOI / arXiv id” is accurate about
what the parser did and wrong about the entry: a PubMed-exported
.bib record carrying pmid = {9659853} is not deficient, and a user
who believes it is will go and edit a bibliography that was fine. The
missing piece is on doiget’s side.
Surfaces as NOT_IMPLEMENTED rather than INVALID_REF: the input is
valid and the support is absent, and the two carry different advice –
“wait for a release” versus “correct your input” (ADR-0055).
Fields
SoftwareUrl
The entry has no DOI or arXiv id but is software on GitHub: its
url is a repository or release (#614). verify checks it still
resolves, and doiget cite <url> renders it as @software.
Fields
InvalidRef
The identifier was present but Ref::parse rejected it
(malformed DOI suffix, invalid arXiv id shape, etc.).
Fields
source: RefParseErrorThe structured Ref::parse failure.
Decode
The whole input did not deserialise — CSL-JSON that is not a
JSON array, top-level malformed JSON, etc. This is a
whole-input failure, not a per-entry failure; callers receive
it as the sole Err element of the result iterator.
Fields
UnsupportedFormat
Format requested or detected, but no parser for it is shipped.
Retained as a forward-compatible variant for input shapes not
yet implemented (e.g. a future RIS adapter); the bibtex and
csl-json paths are both live today.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
impl Eq for ParseError
Source§impl Error for ParseError
impl Error for ParseError
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()
Source§impl PartialEq for ParseError
impl PartialEq for ParseError
Source§fn eq(&self, other: &ParseError) -> bool
fn eq(&self, other: &ParseError) -> bool
self and other values to be equal, and is used by ==.