[][src]Struct netcdf::variable::Variable

pub struct Variable<'g> { /* fields omitted */ }

This struct defines a netCDF variable.

Methods

impl<'g> Variable<'g>[src]

pub fn name(&self) -> String[src]

Get name of variable

pub fn attribute<'a>(&'a self, name: &str) -> Option<Attribute<'a>>[src]

Get an attribute of this variable

pub fn attributes(&self) -> impl Iterator<Item = Attribute>[src]

Iterator over all the attributes of this variable

pub fn dimensions(&self) -> &[Dimension][src]

Dimensions for a variable

pub fn vartype(&self) -> nc_type[src]

Get the type of this variable. This will be an integer such as NC_FLOAT, NC_DOUBLE, NC_INT from the netcdf-sys crate

pub fn len(&self) -> usize[src]

Get current length of the variable

pub fn endian_value(&self) -> Result<Endianness>[src]

Get endianness of the variable.

Errors

Not a netCDF-4 file

impl<'g> Variable<'g>[src]

pub fn value<T: Numeric>(&self, indices: Option<&[usize]>) -> Result<T>[src]

Fetches one specific value at specific indices indices must has the same length as self.dimensions.

pub fn string_value(&self, indices: Option<&[usize]>) -> Result<String>[src]

Reads a string variable. This involves two copies per read, and should be avoided in performance critical code

pub fn values<T: Numeric>(
    &self,
    indices: Option<&[usize]>,
    slice_len: Option<&[usize]>
) -> Result<ArrayD<T>>
[src]

Fetches variable

pub fn fill_value<T: Numeric>(&self) -> Result<Option<T>>[src]

Get the fill value of a variable

pub fn values_to<T: Numeric>(
    &self,
    buffer: &mut [T],
    indices: Option<&[usize]>,
    slice_len: Option<&[usize]>
) -> Result<()>
[src]

Fetches variable into slice buffer must be able to hold all the requested elements

pub fn values_strided_to<T: Numeric>(
    &self,
    buffer: &mut [T],
    indices: Option<&[usize]>,
    slice_len: Option<&[usize]>,
    strides: &[isize]
) -> Result<usize>
[src]

Fetches variable into slice buffer must be able to hold all the requested elements

Trait Implementations

impl<'g> Clone for Variable<'g>[src]

impl<'g> Debug for Variable<'g>[src]

Auto Trait Implementations

impl<'g> RefUnwindSafe for Variable<'g>

impl<'g> Send for Variable<'g>

impl<'g> Sync for Variable<'g>

impl<'g> Unpin for Variable<'g>

impl<'g> UnwindSafe for Variable<'g>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.