[−][src]Enum netcdf3::DataType
All data types supported by the NetCDF-3 format
Example
use netcdf3::{DataType}; assert_eq!("NC_BYTE", DataType::I8.c_api_name()); assert_eq!("NC_CHAR", DataType::U8.c_api_name()); assert_eq!("NC_SHORT", DataType::I16.c_api_name()); assert_eq!("NC_INT", DataType::I32.c_api_name()); assert_eq!("NC_FLOAT", DataType::F32.c_api_name()); assert_eq!("NC_DOUBLE", DataType::F64.c_api_name()); assert_eq!(1, DataType::I8.size_of()); assert_eq!(1, DataType::U8.size_of()); assert_eq!(2, DataType::I16.size_of()); assert_eq!(4, DataType::I32.size_of()); assert_eq!(4, DataType::F32.size_of()); assert_eq!(8, DataType::F64.size_of());
Variants
8-bit signed integer, a.k.a. NC_BYTE
8-bit character, a.k.a. NC_CHAR
16-bit signed integer, a.k.a. NC_SHORT
32-bit signed integer, a.k.a. NC_INT
32-bit floating-point number, a.k.a. NC_FLOAT
64-bit floating-point number, a.k.a. NC_DOUBLE
Methods
impl DataType[src]
pub fn size_of(&self) -> usize[src]
Returns the size (in bytes) of one element of DataType.
Example
assert_eq!(1, DataType::I8.size_of()); assert_eq!(1, DataType::U8.size_of()); assert_eq!(2, DataType::I16.size_of()); assert_eq!(4, DataType::I32.size_of()); assert_eq!(4, DataType::F32.size_of()); assert_eq!(8, DataType::F64.size_of());
pub fn c_api_name(&self) -> &'static str[src]
Returns the name of the DataType commoly used in the NedCDF C API.
Example
assert_eq!("NC_BYTE", DataType::I8.c_api_name()); assert_eq!("NC_CHAR", DataType::U8.c_api_name()); assert_eq!("NC_SHORT", DataType::I16.c_api_name()); assert_eq!("NC_INT", DataType::I32.c_api_name()); assert_eq!("NC_FLOAT", DataType::F32.c_api_name()); assert_eq!("NC_DOUBLE", DataType::F64.c_api_name());
See also
The NetCDF C-API
Trait Implementations
impl Clone for DataType[src]
impl Debug for DataType[src]
impl Display for DataType[src]
impl Eq for DataType[src]
impl PartialEq<DataType> for DataType[src]
impl StructuralEq for DataType[src]
impl StructuralPartialEq for DataType[src]
impl TryFrom<u32> for DataType[src]
Auto Trait Implementations
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,