pub enum Extents {
All,
Extent(Vec<Extent>),
}
Expand description
A selector for putting and getting data along a dataset
This type can be constructed in many ways
use netcdf::{Extent, Extents};
// Get all values
let _: Extents = (..).into();
// Get array with only first 10 of the first dimension
// and the first 2 of the second dimension
let _: Extents = [..10, ..2].into();
// Get values after some index
let _: Extents = [1.., 2..].into();
// The above syntax (using arrays) does not allow arbitrary dimensions,
// for this use tuples
let _: Extents = (
1..10,
(2..=100).step_by(3),
4,
).try_into().unwrap();
// Or specify counts using slices of `Extent`
let _: Extents = [
Extent::SliceCount { start: 0, count: 10, stride: 1 },
(5..).into(),
].into();
// Use two arrays to specify start and count
let _: Extents = (&[1, 2, 3], &[3, 2, 1]).try_into().unwrap();
// Use three arrays to specify start, count and stride
let _: Extents = (&[1, 2, 3], &[3, 2, 1], &[4, 5, 6]).try_into().unwrap();
// The `ndarray::s!` macro can also be used if `ndarray` feature is activated
Variants§
Trait Implementations§
source§impl From<&[RangeInclusive<usize>]> for Extents
impl From<&[RangeInclusive<usize>]> for Extents
source§fn from(slice: &[RangeInclusive<usize>]) -> Self
fn from(slice: &[RangeInclusive<usize>]) -> Self
Converts to this type from the input type.
source§impl From<&[RangeToInclusive<usize>]> for Extents
impl From<&[RangeToInclusive<usize>]> for Extents
source§fn from(slice: &[RangeToInclusive<usize>]) -> Self
fn from(slice: &[RangeToInclusive<usize>]) -> Self
Converts to this type from the input type.
source§impl From<&RangeInclusive<usize>> for Extents
impl From<&RangeInclusive<usize>> for Extents
source§fn from(item: &RangeInclusive<usize>) -> Self
fn from(item: &RangeInclusive<usize>) -> Self
Converts to this type from the input type.
source§impl From<&RangeToInclusive<usize>> for Extents
impl From<&RangeToInclusive<usize>> for Extents
source§fn from(item: &RangeToInclusive<usize>) -> Self
fn from(item: &RangeToInclusive<usize>) -> Self
Converts to this type from the input type.
source§impl From<RangeInclusive<usize>> for Extents
impl From<RangeInclusive<usize>> for Extents
source§fn from(item: RangeInclusive<usize>) -> Self
fn from(item: RangeInclusive<usize>) -> Self
Converts to this type from the input type.
source§impl From<RangeToInclusive<usize>> for Extents
impl From<RangeToInclusive<usize>> for Extents
source§fn from(item: RangeToInclusive<usize>) -> Self
fn from(item: RangeToInclusive<usize>) -> Self
Converts to this type from the input type.
source§impl<T, Din: Dimension, Dout: Dimension> TryFrom<&SliceInfo<T, Din, Dout>> for Extentswhere
T: AsRef<[SliceInfoElem]>,
Available on crate feature ndarray
only.
impl<T, Din: Dimension, Dout: Dimension> TryFrom<&SliceInfo<T, Din, Dout>> for Extentswhere
T: AsRef<[SliceInfoElem]>,
Available on crate feature
ndarray
only.source§impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> TryFrom<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)> for Extentswhere
T0: TryInto<Extent>,
T0::Error: Into<Error>,
T1: TryInto<Extent>,
T1::Error: Into<Error>,
T2: TryInto<Extent>,
T2::Error: Into<Error>,
T3: TryInto<Extent>,
T3::Error: Into<Error>,
T4: TryInto<Extent>,
T4::Error: Into<Error>,
T5: TryInto<Extent>,
T5::Error: Into<Error>,
T6: TryInto<Extent>,
T6::Error: Into<Error>,
T7: TryInto<Extent>,
T7::Error: Into<Error>,
T8: TryInto<Extent>,
T8::Error: Into<Error>,
T9: TryInto<Extent>,
T9::Error: Into<Error>,
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> TryFrom<(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)> for Extentswhere
T0: TryInto<Extent>,
T0::Error: Into<Error>,
T1: TryInto<Extent>,
T1::Error: Into<Error>,
T2: TryInto<Extent>,
T2::Error: Into<Error>,
T3: TryInto<Extent>,
T3::Error: Into<Error>,
T4: TryInto<Extent>,
T4::Error: Into<Error>,
T5: TryInto<Extent>,
T5::Error: Into<Error>,
T6: TryInto<Extent>,
T6::Error: Into<Error>,
T7: TryInto<Extent>,
T7::Error: Into<Error>,
T8: TryInto<Extent>,
T8::Error: Into<Error>,
T9: TryInto<Extent>,
T9::Error: Into<Error>,
source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> TryFrom<(T1, T2, T3, T4, T5, T6, T7, T8, T9)> for Extentswhere
T1: TryInto<Extent>,
T1::Error: Into<Error>,
T2: TryInto<Extent>,
T2::Error: Into<Error>,
T3: TryInto<Extent>,
T3::Error: Into<Error>,
T4: TryInto<Extent>,
T4::Error: Into<Error>,
T5: TryInto<Extent>,
T5::Error: Into<Error>,
T6: TryInto<Extent>,
T6::Error: Into<Error>,
T7: TryInto<Extent>,
T7::Error: Into<Error>,
T8: TryInto<Extent>,
T8::Error: Into<Error>,
T9: TryInto<Extent>,
T9::Error: Into<Error>,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> TryFrom<(T1, T2, T3, T4, T5, T6, T7, T8, T9)> for Extentswhere
T1: TryInto<Extent>,
T1::Error: Into<Error>,
T2: TryInto<Extent>,
T2::Error: Into<Error>,
T3: TryInto<Extent>,
T3::Error: Into<Error>,
T4: TryInto<Extent>,
T4::Error: Into<Error>,
T5: TryInto<Extent>,
T5::Error: Into<Error>,
T6: TryInto<Extent>,
T6::Error: Into<Error>,
T7: TryInto<Extent>,
T7::Error: Into<Error>,
T8: TryInto<Extent>,
T8::Error: Into<Error>,
T9: TryInto<Extent>,
T9::Error: Into<Error>,
source§impl<T2, T3, T4, T5, T6, T7, T8, T9> TryFrom<(T2, T3, T4, T5, T6, T7, T8, T9)> for Extentswhere
T2: TryInto<Extent>,
T2::Error: Into<Error>,
T3: TryInto<Extent>,
T3::Error: Into<Error>,
T4: TryInto<Extent>,
T4::Error: Into<Error>,
T5: TryInto<Extent>,
T5::Error: Into<Error>,
T6: TryInto<Extent>,
T6::Error: Into<Error>,
T7: TryInto<Extent>,
T7::Error: Into<Error>,
T8: TryInto<Extent>,
T8::Error: Into<Error>,
T9: TryInto<Extent>,
T9::Error: Into<Error>,
impl<T2, T3, T4, T5, T6, T7, T8, T9> TryFrom<(T2, T3, T4, T5, T6, T7, T8, T9)> for Extentswhere
T2: TryInto<Extent>,
T2::Error: Into<Error>,
T3: TryInto<Extent>,
T3::Error: Into<Error>,
T4: TryInto<Extent>,
T4::Error: Into<Error>,
T5: TryInto<Extent>,
T5::Error: Into<Error>,
T6: TryInto<Extent>,
T6::Error: Into<Error>,
T7: TryInto<Extent>,
T7::Error: Into<Error>,
T8: TryInto<Extent>,
T8::Error: Into<Error>,
T9: TryInto<Extent>,
T9::Error: Into<Error>,
source§impl<T3, T4, T5, T6, T7, T8, T9> TryFrom<(T3, T4, T5, T6, T7, T8, T9)> for Extentswhere
T3: TryInto<Extent>,
T3::Error: Into<Error>,
T4: TryInto<Extent>,
T4::Error: Into<Error>,
T5: TryInto<Extent>,
T5::Error: Into<Error>,
T6: TryInto<Extent>,
T6::Error: Into<Error>,
T7: TryInto<Extent>,
T7::Error: Into<Error>,
T8: TryInto<Extent>,
T8::Error: Into<Error>,
T9: TryInto<Extent>,
T9::Error: Into<Error>,
impl<T3, T4, T5, T6, T7, T8, T9> TryFrom<(T3, T4, T5, T6, T7, T8, T9)> for Extentswhere
T3: TryInto<Extent>,
T3::Error: Into<Error>,
T4: TryInto<Extent>,
T4::Error: Into<Error>,
T5: TryInto<Extent>,
T5::Error: Into<Error>,
T6: TryInto<Extent>,
T6::Error: Into<Error>,
T7: TryInto<Extent>,
T7::Error: Into<Error>,
T8: TryInto<Extent>,
T8::Error: Into<Error>,
T9: TryInto<Extent>,
T9::Error: Into<Error>,
source§impl<T4, T5, T6, T7, T8, T9> TryFrom<(T4, T5, T6, T7, T8, T9)> for Extents
impl<T4, T5, T6, T7, T8, T9> TryFrom<(T4, T5, T6, T7, T8, T9)> for Extents
source§impl<T5, T6, T7, T8, T9> TryFrom<(T5, T6, T7, T8, T9)> for Extents
impl<T5, T6, T7, T8, T9> TryFrom<(T5, T6, T7, T8, T9)> for Extents
source§impl<T6, T7, T8, T9> TryFrom<(T6, T7, T8, T9)> for Extents
impl<T6, T7, T8, T9> TryFrom<(T6, T7, T8, T9)> for Extents
source§impl<T7, T8, T9> TryFrom<(T7, T8, T9)> for Extents
impl<T7, T8, T9> TryFrom<(T7, T8, T9)> for Extents
Auto Trait Implementations§
impl Freeze for Extents
impl RefUnwindSafe for Extents
impl Send for Extents
impl Sync for Extents
impl Unpin for Extents
impl UnwindSafe for Extents
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more