pub enum Value {
Show 17 variants
String(String),
StringArray(Vec<String>),
Boolean(Vec<bool>),
Bit {
bytes: Vec<u8>,
len: usize,
},
U8(Vec<u8>),
I8(Vec<i8>),
U16(Vec<u16>),
I16(Vec<i16>),
U32(Vec<u32>),
I32(Vec<i32>),
I64(Vec<i64>),
U64(Vec<u64>),
F32(Vec<f32>),
F64(Vec<f64>),
C32(Vec<(f32, f32)>),
M64(Vec<(f64, f64)>),
Null,
}Expand description
One entry of one column of a table.
A FITS column holds a run of values rather than a single one, so every variant here carries a vector even where the run is one long.
Variants§
String(String)
rA: one string of r characters.
StringArray(Vec<String>)
rAw: r / w strings of w characters each.
Boolean(Vec<bool>)
rL: r logicals.
Bit
rX: r bits, packed into ceil(r / 8) bytes.
The bits stay packed because that is how the column stores them; len
says how many of them are real, since the last byte is padded. Use
Value::bits to walk them.
Fields
U8(Vec<u8>)
rB: r unsigned bytes.
I8(Vec<i8>)
rS: r signed bytes.
U16(Vec<u16>)
rU: r unsigned 16-bit integers.
I16(Vec<i16>)
rI: r signed 16-bit integers.
U32(Vec<u32>)
rV: r unsigned 32-bit integers.
I32(Vec<i32>)
rJ: r signed 32-bit integers.
I64(Vec<i64>)
rK: r signed 64-bit integers.
U64(Vec<u64>)
rK with a TZEROn of 2^63: the unsigned reading of a signed column.
F32(Vec<f32>)
rE: r single precision floats.
F64(Vec<f64>)
rD: r double precision floats.
C32(Vec<(f32, f32)>)
rC: single precision complex values, as (real, imaginary) pairs.
M64(Vec<(f64, f64)>)
rM: double precision complex values, as (real, imaginary) pairs.
Null
Every element of this entry is the TNULLn value, so the entry is
undefined. Deserialising it into an Option<T> field yields None.
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_f64(&self) -> Option<&Vec<f64>>
pub fn as_f64(&self) -> Option<&Vec<f64>>
The values if this is a double precision column, or None if it is not.
Sourcepub fn as_f32(&self) -> Option<&Vec<f32>>
pub fn as_f32(&self) -> Option<&Vec<f32>>
The values if this is a single precision column, or None if it is not.
Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more