capwriter

Fast saving and loading with annotating cap for vector and slice

Usage

```rust use capwriter::{Save, Load};

let vectosave: Vec = vec![1, 2, 3, 4, 5];

// (1) Save let mut buffer = Vec::new(); vectosave.saveto(&mut buffer).unwrap(); asserteq!(vectosave.tobesaved_size(), buffer.len()); // size can be estimated

// (2) Load let vecloaded = Vec::::loadfrom( std::io::Cursor::new(buffer) ).unwrap();

asserteq!(vectosave, vecloaded); ```

Supported types

This library provides fast saving and loading of vectors and slices in Rust. However, it is important to ensure that the input data matches the expected data type, as there is NO safe guard for type assertion. If the data type of the input data does not match the expected type, the following consequences may occur: 1. The thread may panic. 2. The data may be loaded successfully, but will not be usable due to the type mismatch. 3. In some cases, the loader may allocate an entire memory space due to incorrect cap.

While scenario (2) and (3) are not common, it is important to be aware of the risks of using this library without proper type checking. It is recommended to thoroughly test the library with different types of data, and to handle errors appropriately in your application code to prevent panics and other unexpected behavior.