Trait npyz::AutoSerialize [−][src]
pub trait AutoSerialize: Serialize { fn default_dtype() -> DType; }
Expand description
Subtrait of Serialize
for types which have a reasonable default DType
.
This opens up some simpler APIs for serialization. (e.g. crate::to_file
, crate::WriterBuilder::default_dtype
)
This trait is derivable when enabling the "derive"
feature. This makes it easier
to work with structured arrays.
For an example of how to implement this manually, see Vector5
in the
roundtrip test.
Required methods
fn default_dtype() -> DType
fn default_dtype() -> DType
A suggested format for serialization.
The builtin implementations for primitive types generally prefer |
endianness if possible,
else the machine endian format.
Implementations on Foreign Types
This impl is only available with the complex
feature.
This impl is only available with the complex
feature.