pub struct FitsKeyword {
pub name: String,
pub comment: String,
/* private fields */
}Expand description
A single FITS keyword extracted from (or destined for) an XISF header: a name, a value, and an optional comment.
The value’s on-disk kind (quoted string vs. bare literal) is preserved; see
IntoValue for how the kind is chosen when you write one.
use xisf_header::FitsKeyword;
let kw = FitsKeyword::new("IMAGETYP", "Master Dark", "Type of image");
assert_eq!(kw.value_str(), "Master Dark");
assert_eq!(kw.comment, "Type of image");Fields§
§name: StringThe keyword name (e.g. EXPTIME), kept verbatim.
comment: StringThe keyword comment (empty when absent).
Implementations§
Source§impl FitsKeyword
impl FitsKeyword
Sourcepub fn new(
name: impl Into<String>,
value: impl IntoValue,
comment: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, value: impl IntoValue, comment: impl Into<String>, ) -> Self
Create a keyword from its name, value, and comment.
use xisf_header::FitsKeyword;
let kw = FitsKeyword::new("GAIN", 100_i64, "Sensor gain");
assert_eq!(kw.get::<i64>(), Some(100));Trait Implementations§
Source§impl Clone for FitsKeyword
impl Clone for FitsKeyword
Source§fn clone(&self) -> FitsKeyword
fn clone(&self) -> FitsKeyword
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FitsKeyword
impl Debug for FitsKeyword
Source§impl Default for FitsKeyword
impl Default for FitsKeyword
Source§fn default() -> FitsKeyword
fn default() -> FitsKeyword
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FitsKeyword
impl<'de> Deserialize<'de> for FitsKeyword
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FitsKeyword
Source§impl PartialEq for FitsKeyword
impl PartialEq for FitsKeyword
Source§impl Serialize for FitsKeyword
impl Serialize for FitsKeyword
impl StructuralPartialEq for FitsKeyword
Auto Trait Implementations§
impl Freeze for FitsKeyword
impl RefUnwindSafe for FitsKeyword
impl Send for FitsKeyword
impl Sync for FitsKeyword
impl Unpin for FitsKeyword
impl UnsafeUnpin for FitsKeyword
impl UnwindSafe for FitsKeyword
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