pub trait ArrayProtocol {
// Required methods
fn array_interface(&self) -> ArrayInterfaceDict;
fn dtype_str(&self) -> &'static str;
fn shape(&self) -> Vec<usize>;
fn strides(&self) -> Vec<usize>;
fn data_ptr(&self) -> *const u8;
fn nbytes(&self) -> usize;
}Expand description
Mixin trait for types that support the NumPy array interface protocol.
Implementors must provide shape, stride, type-string, and a raw data
pointer, from which a complete ArrayInterfaceDict can be assembled.
Required Methods§
Sourcefn array_interface(&self) -> ArrayInterfaceDict
fn array_interface(&self) -> ArrayInterfaceDict
Returns the populated ArrayInterfaceDict for this object.