pub enum NDDataBuffer {
I8(Vec<i8>),
U8(Vec<u8>),
I16(Vec<i16>),
U16(Vec<u16>),
I32(Vec<i32>),
U32(Vec<u32>),
I64(Vec<i64>),
U64(Vec<u64>),
F32(Vec<f32>),
F64(Vec<f64>),
}Expand description
Typed buffer for NDArray data.
Variants§
I8(Vec<i8>)
U8(Vec<u8>)
I16(Vec<i16>)
U16(Vec<u16>)
I32(Vec<i32>)
U32(Vec<u32>)
I64(Vec<i64>)
U64(Vec<u64>)
F32(Vec<f32>)
F64(Vec<f64>)
Implementations§
Source§impl NDDataBuffer
impl NDDataBuffer
pub fn zeros(data_type: NDDataType, count: usize) -> Self
pub fn data_type(&self) -> NDDataType
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn total_bytes(&self) -> usize
Sourcepub fn capacity_bytes(&self) -> usize
pub fn capacity_bytes(&self) -> usize
Capacity of the underlying Vec in bytes.
Sourcepub fn as_u8_slice(&self) -> &[u8] ⓘ
pub fn as_u8_slice(&self) -> &[u8] ⓘ
View the underlying data as a byte slice.
Sourcepub fn get_as_f64(&self, index: usize) -> Option<f64>
pub fn get_as_f64(&self, index: usize) -> Option<f64>
Get element at index as f64.
Sourcepub fn set_from_f64(&mut self, index: usize, value: f64)
pub fn set_from_f64(&mut self, index: usize, value: f64)
Set element at index from f64 value.
Trait Implementations§
Source§impl Clone for NDDataBuffer
impl Clone for NDDataBuffer
Source§fn clone(&self) -> NDDataBuffer
fn clone(&self) -> NDDataBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NDDataBuffer
impl RefUnwindSafe for NDDataBuffer
impl Send for NDDataBuffer
impl Sync for NDDataBuffer
impl Unpin for NDDataBuffer
impl UnsafeUnpin for NDDataBuffer
impl UnwindSafe for NDDataBuffer
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