[−][src]Struct netcdf::variable::Variable
This struct defines a netCDF variable.
Implementations
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) -> VariableType[src]
Get the type of this variable
pub fn len(&self) -> usize[src]
Get current length of the variable
pub fn endian_value(&self) -> Result<Endianness>[src]
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]
&self,
indices: Option<&[usize]>,
slice_len: Option<&[usize]>
) -> Result<ArrayD<T>>
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]
&self,
buffer: &mut [T],
indices: Option<&[usize]>,
slice_len: Option<&[usize]>
) -> Result<()>
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]
&self,
buffer: &mut [T],
indices: Option<&[usize]>,
slice_len: Option<&[usize]>,
strides: &[isize]
) -> Result<usize>
Fetches variable into slice buffer must be able to hold all the requested elements
pub fn raw_values(
&self,
buf: &mut [u8],
start: &[usize],
count: &[usize]
) -> Result<()>[src]
&self,
buf: &mut [u8],
start: &[usize],
count: &[usize]
) -> Result<()>
Get values of any type as bytes, with no further interpretation of the values.
Note
When working with compound types, variable length arrays and
strings will be allocated in buf, and this library will
not keep track of the allocations.
This can lead to memory leaks.
pub fn vlen<T: Numeric>(&self, index: &[usize]) -> Result<Vec<T>>[src]
Get a vlen element
Trait Implementations
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]
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> Pointable for T[src]
const ALIGN: usize[src]
type Init = T
The type for initializers.
unsafe fn init(init: <T as Pointable>::Init) -> usize[src]
unsafe fn deref<'a>(ptr: usize) -> &'a T[src]
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T[src]
unsafe fn drop(ptr: usize)[src]
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, 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>,