Expand description
Error types for MARC operations.
Provides MarcError for all MARC library operations and the Result
convenience type. Each variant carries structured positional metadata
describing where in a stream/record/field the problem occurred — see the
per-variant requirements in the documentation for which fields are always
populated, may be populated, or are not applicable.
All variants are Send + Sync so errors can cross thread boundaries used
by the parallel parsing paths.
Structs§
- Bytes
Near - Byte window captured near the point of an error, used to render a hex
dump in
MarcError::detailedoutput. - Error
Metadata - Borrowed snapshot of the structured metadata carried by a
MarcError.
Enums§
- Marc
Error - Error type for all MARC library operations.
Constants§
- BYTES_
NEAR_ AFTER - Number of bytes retained after the error offset in
BytesNear. - BYTES_
NEAR_ BEFORE - Number of bytes retained before the error offset in
BytesNear. - DOCS_
BASE_ URL - Base URL for the docs site. Used by
MarcError::help_url. - FOUND_
BYTES_ CAP - Maximum length in bytes retained in a
MarcError’sfoundfield. - SCHEMA_
VERSION - Schema identifier included in
MarcError::to_json_valueoutput so consumers can branch on it if the shape changes later. Pre-1.0, the shape may still evolve.
Functions§
- empty_
errors_ arc - Shared empty
Arc<Vec<MarcError>>used as the default value for theerrorsfield on freshly constructed records. Returned byRecord::new/AuthorityRecord::new/HoldingsRecord::newand kept as-is by readers when no errors accumulate during a parse. - render_
hex_ dump - Render a
BytesNearwindow as a hex + ASCII dump, with an optional caret pointing at the offending byte. - truncate_
bytes - Truncate a byte slice to at most
FOUND_BYTES_CAPbytes.
Type Aliases§
- Result
- Convenience type alias for
std::result::ResultwithMarcError.