pub enum Key {
Name(String),
Occurrence(String, usize),
}Expand description
Selects a record by keyword.
A bare name is strict: get/set/remove error with
FitsError::AmbiguousKeyword if the keyword is
duplicated. The (name, occurrence) form targets exactly one record (0-based).
§Examples
let mut h = Header::new();
h.append("GAIN", 100).unwrap();
h.append("GAIN", 200).unwrap();
assert!(h.get::<i64>("GAIN").is_err()); // ambiguous bare name
assert_eq!(h.get::<i64>(("GAIN", 1)).unwrap(), Some(200)); // explicit occurrenceVariants§
Name(String)
The sole occurrence of a keyword (strict).
Occurrence(String, usize)
The n-th (0-based) occurrence of a keyword.
Implementations§
Trait Implementations§
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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