Trait ByteArrayView

Source
pub trait ByteArrayView<'transient, 'lifespan>
where 'lifespan: 'transient,
{
Show 18 methods // Required methods fn view( &'lifespan self, ) -> Result<Cow<'lifespan, [u8]>, ArrayRetrievalError>; fn name(&self) -> &ArrayType; fn dtype(&self) -> BinaryDataArrayType; fn unit(&self) -> Unit; // Provided methods fn coerce_from<T>( buffer: Cow<'transient, [u8]>, ) -> Result<Cow<'transient, [T]>, ArrayRetrievalError> where T: Pod { ... } fn coerce<T>( &'lifespan self, ) -> Result<Cow<'transient, [T]>, ArrayRetrievalError> where T: Pod { ... } fn convert<S, D>( &'lifespan self, ) -> Result<Cow<'transient, [D]>, ArrayRetrievalError> where S: Num + Clone + AsPrimitive<D> + Pod, D: Num + Clone + Copy + 'static { ... } fn to_f32( &'lifespan self, ) -> Result<Cow<'transient, [f32]>, ArrayRetrievalError> { ... } fn to_f64( &'lifespan self, ) -> Result<Cow<'transient, [f64]>, ArrayRetrievalError> { ... } fn to_i32( &'lifespan self, ) -> Result<Cow<'transient, [i32]>, ArrayRetrievalError> { ... } fn to_i64( &'lifespan self, ) -> Result<Cow<'transient, [i64]>, ArrayRetrievalError> { ... } fn data_len(&'lifespan self) -> Result<usize, ArrayRetrievalError> { ... } fn iter_type<T>( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, T>, ArrayRetrievalError> where T: Pod { ... } fn iter_u8( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, u8>, ArrayRetrievalError> { ... } fn iter_f32( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, f32>, ArrayRetrievalError> { ... } fn iter_f64( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, f64>, ArrayRetrievalError> { ... } fn iter_i32( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, i32>, ArrayRetrievalError> { ... } fn iter_i64( &'lifespan self, ) -> Result<DataSliceIter<'lifespan, i64>, ArrayRetrievalError> { ... }
}

Required Methods§

Source

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

Source

fn name(&self) -> &ArrayType

The kind of array this is

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

Provided Methods§

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>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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

Source§

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