pub trait NcReadType:
Clone
+ Default
+ Send
+ 'static {
// Required methods
fn nc_type() -> NcType;
fn from_be_bytes(bytes: &[u8]) -> Result<Self>;
fn element_size() -> usize;
// Provided method
fn decode_bulk_be(raw: &[u8], count: usize) -> Result<Vec<Self>> { ... }
}Expand description
Trait for types that can be read from classic NetCDF data.
Required Methods§
Sourcefn from_be_bytes(bytes: &[u8]) -> Result<Self>
fn from_be_bytes(bytes: &[u8]) -> Result<Self>
Read a single element from big-endian bytes.
Sourcefn element_size() -> usize
fn element_size() -> usize
Size in bytes of one element.
Provided Methods§
Sourcefn decode_bulk_be(raw: &[u8], count: usize) -> Result<Vec<Self>>
fn decode_bulk_be(raw: &[u8], count: usize) -> Result<Vec<Self>>
Bulk decode count elements from a contiguous big-endian byte slice.
Default implementation falls back to per-element decoding. Types with
multi-byte elements override this with an optimized bulk path using
chunks_exact + byte-swap (on LE hosts) or copy_nonoverlapping
(on BE hosts).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.