pub enum Value {
Str(String),
Literal(String),
}Expand description
A keyword value together with how it should be serialized.
XISF stores FITS keyword values with FITS formatting conventions: string values are single-quoted, everything else (numbers, logicals) is bare. The distinction is preserved so a value round-trips as the same kind it was.
use xisf_header::Value;
let string_value = Value::Str("Master Dark".to_owned());
let literal_value = Value::Literal("300".to_owned());
assert_eq!(string_value.text(), "Master Dark");
assert_eq!(literal_value.text(), "300");Variants§
Str(String)
A string value (serialized single-quoted, ''-escaped).
Literal(String)
A bare literal — number, logical, or any pre-formatted token.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
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 Value
Source§impl IntoValue for Value
impl IntoValue for Value
Source§fn into_value(self) -> Value
fn into_value(self) -> Value
Convert
self into a serializable Value.impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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