DataArraySlice

Struct DataArraySlice 

Source
pub struct DataArraySlice<'a> {
    pub start: usize,
    pub end: usize,
    /* private fields */
}
Expand description

Represent a slice of a DataArray that manages offsets and decoding automatically.

Fields§

§start: usize§end: usize

Implementations§

Source§

impl<'a> DataArraySlice<'a>

Source

pub fn new( source: &'a DataArray, start: usize, end: usize, ) -> DataArraySlice<'a>

Source

pub fn decode(&'a self) -> Result<Cow<'a, [u8]>, ArrayRetrievalError>

Source

pub const fn is_ion_mobility(&self) -> bool

Trait Implementations§

Source§

impl<'transient, 'lifespan> ByteArrayView<'transient, 'lifespan> for DataArraySlice<'lifespan>
where 'lifespan: 'transient,

Source§

fn view(&'lifespan self) -> Result<Cow<'lifespan, [u8]>, ArrayRetrievalError>

Source§

fn dtype(&self) -> BinaryDataArrayType

The real data type encoded in bytes
Source§

fn unit(&self) -> Unit

The unit of measurement each data point is in
Source§

fn name(&self) -> &ArrayType

The kind of array this is
Source§

fn data_processing_reference(&self) -> Option<&str>

Get the identifier referencing a DataProcessing
Source§

fn coerce_from<T>( buffer: Cow<'transient, [u8]>, ) -> Result<Cow<'transient, [T]>, ArrayRetrievalError>
where T: Pod,

Source§

fn coerce<T>( &'lifespan self, ) -> Result<Cow<'transient, [T]>, ArrayRetrievalError>
where T: Pod,

Source§

fn convert<S, D>( &'lifespan self, ) -> Result<Cow<'transient, [D]>, ArrayRetrievalError>
where S: Num + Clone + AsPrimitive<D> + Pod, D: Num + Clone + Copy + 'static,

Decode the array, then copy it to a new array, converting each element from type D to to type S
Source§

fn to_f32( &'lifespan self, ) -> Result<Cow<'transient, [f32]>, ArrayRetrievalError>

Source§

fn to_f64( &'lifespan self, ) -> Result<Cow<'transient, [f64]>, ArrayRetrievalError>

Source§

fn to_i32( &'lifespan self, ) -> Result<Cow<'transient, [i32]>, ArrayRetrievalError>

Source§

fn to_i64( &'lifespan self, ) -> Result<Cow<'transient, [i64]>, ArrayRetrievalError>

Source§

fn data_len(&'lifespan self) -> Result<usize, ArrayRetrievalError>

The size of encoded array in terms of # of elements of the BinaryDataArrayType given by ByteArrayView::dtype
Source§

fn iter_type<T>( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, T>, ArrayRetrievalError>
where T: Pod,

Source§

fn iter_u8( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, u8>, ArrayRetrievalError>

Source§

fn iter_f32( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, f32>, ArrayRetrievalError>

Source§

fn iter_f64( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, f64>, ArrayRetrievalError>

Source§

fn iter_i32( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, i32>, ArrayRetrievalError>

Source§

fn iter_i64( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, i64>, ArrayRetrievalError>

Source§

impl<'a> Clone for DataArraySlice<'a>

Source§

fn clone(&self) -> DataArraySlice<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for DataArraySlice<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for DataArraySlice<'a>

§

impl<'a> RefUnwindSafe for DataArraySlice<'a>

§

impl<'a> Send for DataArraySlice<'a>

§

impl<'a> Sync for DataArraySlice<'a>

§

impl<'a> Unpin for DataArraySlice<'a>

§

impl<'a> UnwindSafe for DataArraySlice<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.