[][src]Trait netcdf::variable::Numeric

pub unsafe trait Numeric where
    Self: Sized
{ const NCTYPE: nc_type; unsafe fn single_value_from_variable(
        variable: &Variable<'_>,
        indices: &[usize]
    ) -> Result<Self>;
unsafe fn variable_to_ptr(
        variable: &Variable<'_>,
        indices: &[usize],
        slice_len: &[usize],
        values: *mut Self
    ) -> Result<()>;
unsafe fn put_value_at(
        variable: &mut VariableMut<'_>,
        indices: &[usize],
        value: Self
    ) -> Result<()>;
unsafe fn put_values_at(
        variable: &mut VariableMut<'_>,
        indices: &[usize],
        slice_len: &[usize],
        values: &[Self]
    ) -> Result<()>;
unsafe fn get_values_strided(
        variable: &Variable<'_>,
        indices: &[usize],
        slice_len: &[usize],
        strides: &[isize],
        values: *mut Self
    ) -> Result<()>;
unsafe fn put_values_strided(
        variable: &mut VariableMut<'_>,
        indices: &[usize],
        slice_len: &[usize],
        strides: &[isize],
        values: *const Self
    ) -> Result<()>; }

This trait allow an implicit cast when fetching a netCDF variable. These methods are not be called directly, but used through methods on Variable

Associated Constants

const NCTYPE: nc_type

Constant corresponding to a netcdf type

Loading content...

Required methods

unsafe fn single_value_from_variable(
    variable: &Variable<'_>,
    indices: &[usize]
) -> Result<Self>

Returns a single indexed value of the variable as Self

Safety

Requires indices to be of a valid length

unsafe fn variable_to_ptr(
    variable: &Variable<'_>,
    indices: &[usize],
    slice_len: &[usize],
    values: *mut Self
) -> Result<()>

Get multiple values at once, without checking the validity of indices or slice_len

Safety

Requires values to be of at least size slice_len.product(), indices and slice_len to be of a valid length

unsafe fn put_value_at(
    variable: &mut VariableMut<'_>,
    indices: &[usize],
    value: Self
) -> Result<()>

Put a single value into a netCDF variable

Safety

Requires indices to be of a valid length

unsafe fn put_values_at(
    variable: &mut VariableMut<'_>,
    indices: &[usize],
    slice_len: &[usize],
    values: &[Self]
) -> Result<()>

put a SLICE of values into a netCDF variable at the given index

Safety

Requires indices and slice_len to be of a valid length

unsafe fn get_values_strided(
    variable: &Variable<'_>,
    indices: &[usize],
    slice_len: &[usize],
    strides: &[isize],
    values: *mut Self
) -> Result<()>

get a SLICE of values into the variable, with the source strided by strides

Safety

values must contain space for all the data, indices, slice_len, and strides must be of at least dimension length size.

unsafe fn put_values_strided(
    variable: &mut VariableMut<'_>,
    indices: &[usize],
    slice_len: &[usize],
    strides: &[isize],
    values: *const Self
) -> Result<()>

put a SLICE of values into the variable, with the destination strided by strides

Safety

values must contain space for all the data, indices, slice_len, and strides must be of at least dimension length size.

Loading content...

Implementations on Foreign Types

impl Numeric for u8[src]

impl Numeric for i8[src]

impl Numeric for i16[src]

impl Numeric for u16[src]

impl Numeric for i32[src]

impl Numeric for u32[src]

impl Numeric for i64[src]

impl Numeric for u64[src]

impl Numeric for f32[src]

impl Numeric for f64[src]

Loading content...

Implementors

Loading content...