pub enum BufView<'a> {
F32(&'a [f32]),
I32(&'a [i32]),
U8(&'a [u8]),
U16(&'a [u16]),
U32(&'a [u32]),
I64(&'a [i64]),
F16(&'a [f16]),
BF16(&'a [bf16]),
I8(&'a [i8]),
}Variants§
F32(&'a [f32])
I32(&'a [i32])
U8(&'a [u8])
U16(&'a [u16])
U32(&'a [u32])
I64(&'a [i64])
F16(&'a [f16])
BF16(&'a [bf16])
I8(&'a [i8])
Implementations§
Source§impl<'a> BufView<'a>
impl<'a> BufView<'a>
pub fn len(&self) -> usize
pub fn num_bytes(&self) -> usize
pub fn dtype(&self) -> DataTypeKind
Sourcepub fn as_mut_ptr(&self) -> *mut c_void
pub fn as_mut_ptr(&self) -> *mut c_void
Returns a pointer to the buffer for the C API.
§Safety
This performs a const cast from an immutable slice pointer (*const T)
to a mutable void pointer (*mut c_void).
The caller must guarantee that the C API function this pointer is passed to will not modify the memory it points to.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for BufView<'a>
impl<'a> RefUnwindSafe for BufView<'a>
impl<'a> Send for BufView<'a>
impl<'a> Sync for BufView<'a>
impl<'a> Unpin for BufView<'a>
impl<'a> UnsafeUnpin for BufView<'a>
impl<'a> UnwindSafe for BufView<'a>
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