pub enum DmapVec {
Char(ArrayD<i8>),
Short(ArrayD<i16>),
Int(ArrayD<i32>),
Long(ArrayD<i64>),
Uchar(ArrayD<u8>),
Ushort(ArrayD<u16>),
Uint(ArrayD<u32>),
Ulong(ArrayD<u64>),
Float(ArrayD<f32>),
Double(ArrayD<f64>),
}Expand description
A vector field in a DMAP record.
Variants§
Char(ArrayD<i8>)
Short(ArrayD<i16>)
Int(ArrayD<i32>)
Long(ArrayD<i64>)
Uchar(ArrayD<u8>)
Ushort(ArrayD<u16>)
Uint(ArrayD<u32>)
Ulong(ArrayD<u64>)
Float(ArrayD<f32>)
Double(ArrayD<f64>)
Implementations§
Source§impl DmapVec
impl DmapVec
Sourcepub fn shape(&self) -> &[usize]
pub fn shape(&self) -> &[usize]
Gets the dimensions of the vector, in row-major order.
§Example
use numpy::ndarray::array;
use dmap::types::DmapVec;
let arr = DmapVec::Char(array![0, 1, 2, 3, 4].into_dyn());
assert_eq!(arr.shape(), &[5]);
let arr = DmapVec::Uint(array![[0, 1, 2], [3, 4, 5]].into_dyn());
assert_eq!(arr.shape(), &[2, 3]);Trait Implementations§
Source§impl<'py> FromPyObject<'py> for DmapVec
impl<'py> FromPyObject<'py> for DmapVec
Source§impl<'py> IntoPyObject<'py> for DmapVec
impl<'py> IntoPyObject<'py> for DmapVec
impl StructuralPartialEq for DmapVec
Auto Trait Implementations§
impl Freeze for DmapVec
impl RefUnwindSafe for DmapVec
impl Send for DmapVec
impl Sync for DmapVec
impl Unpin for DmapVec
impl UnwindSafe for DmapVec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information.