Skip to content

Commit

Permalink
Add fill_value support
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Aug 6, 2024
1 parent 5fe3e75 commit 674df3a
Show file tree
Hide file tree
Showing 2 changed files with 316 additions and 20 deletions.
27 changes: 17 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,32 @@ impl From<ChunkKeyEncoding> for u8 {
}
}

#[repr(u8)]
#[derive(Clone, Debug, PartialEq)]
pub enum FillValue {
Bool(bool),
Int8(i8),
Int16(i16),
Int32(i32),
// Bool(bool),
// Int8(i8),
// Int16(i16),
Int32(i32) = 1,
Int64(i64),
UInt8(u8),
UInt16(u16),
UInt32(u32),
UInt64(u64),
Float16(f32),
// UInt8(u8),
// UInt16(u16),
// UInt32(u32),
// UInt64(u64),
// Float16(f32),
Float32(f32),
Float64(f64),
Complex64(f32, f32),
Complex128(f64, f64),
// Complex128(f64, f64),
RawBits(Vec<u8>),
}

impl FillValue {
// https://doc.rust-lang.org/reference/items/enumerations.html#pointer-casting
fn discriminant(&self) -> i8 {
unsafe { *(self as *const Self as *const i8) }
}
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Codecs(String); // FIXME: define

Expand Down
Loading

0 comments on commit 674df3a

Please sign in to comment.