pub trait NcPutGet: Sealedwhere
Self: Sized,{
const NCTYPE: nc_type;
// Required methods
unsafe fn get_var1(variable: &Variable<'_>, start: &[usize]) -> Result<Self>;
unsafe fn put_var1(
variable: &mut VariableMut<'_>,
start: &[usize],
value: Self
) -> Result<()>;
unsafe fn get_vara(
variable: &Variable<'_>,
start: &[usize],
count: &[usize],
values: *mut Self
) -> Result<()>;
unsafe fn put_vara(
variable: &mut VariableMut<'_>,
start: &[usize],
count: &[usize],
values: &[Self]
) -> Result<()>;
unsafe fn get_vars(
variable: &Variable<'_>,
start: &[usize],
count: &[usize],
stride: &[isize],
values: *mut Self
) -> Result<()>;
unsafe fn put_vars(
variable: &mut VariableMut<'_>,
start: &[usize],
count: &[usize],
stride: &[isize],
values: *const Self
) -> Result<()>;
unsafe fn get_varm(
variable: &Variable<'_>,
start: &[usize],
count: &[usize],
stride: &[isize],
map: &[isize],
values: *mut Self
) -> Result<()>;
unsafe fn put_varm(
variable: &mut VariableMut<'_>,
start: &[usize],
count: &[usize],
stride: &[isize],
map: &[isize],
values: *const Self
) -> Result<()>;
}
Expand description
This trait allow an implicit cast when fetching
a netCDF variable. These methods are not be called
directly, but used through methods on Variable
§Safety
This trait maps directly to netCDF semantics and needs to upheld invariants therein. This trait is sealed and can not be implemented for types outside this crate
Required Associated Constants§
Required Methods§
sourceunsafe fn get_var1(variable: &Variable<'_>, start: &[usize]) -> Result<Self>
unsafe fn get_var1(variable: &Variable<'_>, start: &[usize]) -> Result<Self>
Returns a single indexed value of the variable as Self
§Safety
Requires indices
to be of a valid length
sourceunsafe fn put_var1(
variable: &mut VariableMut<'_>,
start: &[usize],
value: Self
) -> Result<()>
unsafe fn put_var1( variable: &mut VariableMut<'_>, start: &[usize], value: Self ) -> Result<()>
sourceunsafe fn get_vara(
variable: &Variable<'_>,
start: &[usize],
count: &[usize],
values: *mut Self
) -> Result<()>
unsafe fn get_vara( variable: &Variable<'_>, start: &[usize], count: &[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
sourceunsafe fn put_vara(
variable: &mut VariableMut<'_>,
start: &[usize],
count: &[usize],
values: &[Self]
) -> Result<()>
unsafe fn put_vara( variable: &mut VariableMut<'_>, start: &[usize], count: &[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
sourceunsafe fn get_vars(
variable: &Variable<'_>,
start: &[usize],
count: &[usize],
stride: &[isize],
values: *mut Self
) -> Result<()>
unsafe fn get_vars( variable: &Variable<'_>, start: &[usize], count: &[usize], stride: &[isize], values: *mut Self ) -> Result<()>
get a SLICE of values into the variable, with the source
strided by stride
§Safety
values
must contain space for all the data,
indices
, slice_len
, and stride
must be of
at least dimension length size.
sourceunsafe fn put_vars(
variable: &mut VariableMut<'_>,
start: &[usize],
count: &[usize],
stride: &[isize],
values: *const Self
) -> Result<()>
unsafe fn put_vars( variable: &mut VariableMut<'_>, start: &[usize], count: &[usize], stride: &[isize], values: *const Self ) -> Result<()>
put a SLICE of values into the variable, with the destination
strided by stride
§Safety
values
must contain space for all the data,
indices
, slice_len
, and stride
must be of
at least dimension length size.
sourceunsafe fn get_varm(
variable: &Variable<'_>,
start: &[usize],
count: &[usize],
stride: &[isize],
map: &[isize],
values: *mut Self
) -> Result<()>
unsafe fn get_varm( variable: &Variable<'_>, start: &[usize], count: &[usize], stride: &[isize], map: &[isize], values: *mut Self ) -> Result<()>
get a SLICE of values into the variable, with the source
strided by stride
, mapped by map
§Safety
values
must contain space for all the data,
indices
, slice_len
, and stride
must be of
at least dimension length size.
sourceunsafe fn put_varm(
variable: &mut VariableMut<'_>,
start: &[usize],
count: &[usize],
stride: &[isize],
map: &[isize],
values: *const Self
) -> Result<()>
unsafe fn put_varm( variable: &mut VariableMut<'_>, start: &[usize], count: &[usize], stride: &[isize], map: &[isize], values: *const Self ) -> Result<()>
put a SLICE of values into the variable, with the destination
strided by stride
§Safety
values
must contain space for all the data,
indices
, slice_len
, and stride
must be of
at least dimension length size.