Trait ndarray_npy::WritableElement
source · pub trait WritableElement: Sized {
// Required methods
fn type_descriptor() -> PyValue;
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>;
fn write_slice<W: Write>(
slice: &[Self],
writer: W,
) -> Result<(), WriteDataError>;
}Expand description
An array element type that can be written to an .npy or .npz file.
Required Methods§
sourcefn type_descriptor() -> PyValue
fn type_descriptor() -> PyValue
Returns a descriptor of the type that can be used in the header.
sourcefn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
Writes a single instance of Self to the writer.
sourcefn write_slice<W: Write>(
slice: &[Self],
writer: W,
) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Writes a slice of Self to the writer.
Object Safety§
This trait is not object safe.