save-load-derive
save-load-derive is a Rust crate designed to streamline file serialization and deserialization processes for custom types by utilizing procedural macros. It automatically generates implementations for the SaveToFile and LoadFromFile traits using serde for serialization and tokio for asynchronous file operations.
Features
- Automated Code Generation: Utilizes Rust's procedural macros to derive
SaveToFileandLoadFromFileimplementations, reducing boilerplate. - Asynchronous Operations: Employs
tokioto facilitate asynchronous reading from and writing to files, enhancing performance in I/O bound tasks. - Serialize and Deserialize: Leverages
serdeto support the versatile serialization and deserialization of types. - Error Handling: Implements custom error handling using a defined
SaveLoadErrortype.
Usage
To use the save-load-derive crate, apply the SaveLoad derive macro to your structs:
use SaveLoad;
Ensure your type derives or implements serde::Serialize and for<'de> serde::Deserialize<'de> for the macro to succeed without compile errors due to missing trait bounds.
Example
use SaveLoad;
use ;
// In asynchronous contexts:
async
License
This crate is licensed under the MIT License.
Note: This README was generated by an AI model and may not be 100% accurate, although it aims to be comprehensive and useful.