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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl WritableElement for bool
impl WritableElement for bool
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for f32
impl WritableElement for f32
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for f64
impl WritableElement for f64
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for i8
impl WritableElement for i8
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for i16
impl WritableElement for i16
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for i32
impl WritableElement for i32
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for i64
impl WritableElement for i64
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for u8
impl WritableElement for u8
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for u16
impl WritableElement for u16
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for u32
impl WritableElement for u32
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for u64
impl WritableElement for u64
fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for Complex<f32>
Available on crate feature num-complex-0_4 only.
impl WritableElement for Complex<f32>
Available on crate feature
num-complex-0_4 only.fn type_descriptor() -> Value
fn write<W: Write>(&self, writer: W) -> Result<(), WriteDataError>
fn write_slice<W: Write>( slice: &[Self], writer: W, ) -> Result<(), WriteDataError>
Source§impl WritableElement for Complex<f64>
Available on crate feature num-complex-0_4 only.
impl WritableElement for Complex<f64>
Available on crate feature
num-complex-0_4 only.