pub trait AsRawBuffer {
// Required methods
fn raw_ptr(&self) -> *const u8;
fn raw_shape(&self) -> &[usize];
fn raw_strides_bytes(&self) -> Vec<isize>;
fn raw_dtype(&self) -> DType;
fn is_c_contiguous(&self) -> bool;
fn is_f_contiguous(&self) -> bool;
}Expand description
Trait exposing the raw memory layout of an array for zero-copy interop.
Implementors provide enough information for foreign code (C, Python/NumPy, Arrow, etc.) to read the array data without copying.
Required Methods§
Sourcefn raw_strides_bytes(&self) -> Vec<isize>
fn raw_strides_bytes(&self) -> Vec<isize>
Strides in bytes (not elements).
Sourcefn is_c_contiguous(&self) -> bool
fn is_c_contiguous(&self) -> bool
Whether the data is C-contiguous.
Sourcefn is_f_contiguous(&self) -> bool
fn is_f_contiguous(&self) -> bool
Whether the data is Fortran-contiguous.