Skip to main content

netcdf_reader/
types.rs

1//! NetCDF data model re-exported from `netcdf-core`.
2
3pub use netcdf_core::{
4    NcAttrValue, NcAttribute, NcCompoundField, NcDimension, NcEnumMember, NcFormat, NcGroup,
5    NcIntegerValue, NcMetadataMode, NcSliceInfo, NcSliceInfoElem, NcType, NcVariable,
6};
7
8pub(crate) fn checked_usize_from_u64(value: u64, context: &str) -> crate::Result<usize> {
9    netcdf_core::checked_usize_from_u64(value, context).map_err(Into::into)
10}
11
12pub(crate) fn checked_mul_u64(lhs: u64, rhs: u64, context: &str) -> crate::Result<u64> {
13    netcdf_core::checked_mul_u64(lhs, rhs, context).map_err(Into::into)
14}
15
16pub(crate) fn checked_shape_elements(shape: &[u64], context: &str) -> crate::Result<u64> {
17    netcdf_core::checked_shape_elements(shape, context).map_err(Into::into)
18}