#[non_exhaustive]pub enum FitsError {
AmbiguousKeyword {
keyword: String,
count: usize,
},
KeywordTooLong {
keyword: String,
},
InvalidKeyword {
keyword: String,
},
OccurrenceOutOfRange {
keyword: String,
occurrence: usize,
count: usize,
},
MissingEnd,
TruncatedHeader,
Io(String),
}Expand description
Errors from validated header mutations, ambiguous lookups, and oversized standalone serialization.
Parsing is lenient and does not produce these; header-only serialization
(Header::to_header_bytes) is infallible.
§Examples
let mut h = Header::new();
h.append("GAIN", 1).unwrap();
h.append("GAIN", 2).unwrap();
assert!(matches!(
h.get::<i64>("GAIN"),
Err(FitsError::AmbiguousKeyword { .. })
));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AmbiguousKeyword
A bare-name get/set/remove addressed a keyword that occurs more than once.
Select one with an (name, occurrence) key.
KeywordTooLong
A keyword longer than the 8-character FITS field.
InvalidKeyword
A keyword containing bytes outside the FITS keyword set (A-Z 0-9 - _).
OccurrenceOutOfRange
An (name, occurrence) key targeted an occurrence that does not exist.
Fields
MissingEnd
Header::update_file found no END card in the
existing file’s header region, so the data unit’s boundary cannot be located.
TruncatedHeader
Header::update_file found an END card, but the file
ends before that header’s 2880-byte block is complete — a truncated FITS file.
Io(String)
A file read or write failed (Header::read_from_file,
Header::update_file).
Trait Implementations§
impl Eq for FitsError
Source§impl Error for FitsError
impl Error for FitsError
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()