| Crates.io | array-object |
| lib.rs | array-object |
| version | 0.3.0 |
| created_at | 2024-10-13 19:59:43.874578+00 |
| updated_at | 2026-01-16 14:41:22.02079+00 |
| description | Self-describing binary format for arrays of integers, floating-point numbers, complex numbers, and strings. It is designed for object storage, database integration, and single-file usage. |
| homepage | |
| repository | https://github.com/YShoji-HEP/ArrayObject |
| max_upload_size | |
| id | 1407645 |
| size | 139,840 |
ArrayObject is a self-describing binary format for arrays of integers, floating-point numbers, complex numbers, and strings. It is designed for efficient object storage, database integration, and single-file use.
ArrayObject is part of the dbgbb project.
Vec<_>, [T; N], ndarray, and nalgebra.use array_object::*;
fn main() {
// Convert data into binary
let original = vec![1u32, 2, 3, 4];
let obj: ArrayObject = original.clone().try_into().unwrap();
let packed = obj.pack(); // Converts data into Vec<u8>
// Restore data
let unpacked = ArrayObject::unpack(packed).unwrap();
let inflated: Vec<u32> = unpacked.try_into().unwrap();
assert_eq!(original, inflated);
}
use array_object::*;
fn main() {
// Save to a file
let original = vec![1f64, 2.2, -1.1, 5.6];
export_obj!("testdata.bin", original.clone()); // Overwrites if file exists
// Load from a file
let restored: Vec<f64> = import_obj!("testdata.bin"); // Type annotation required
assert_eq!(original, restored);
}
| Feature | Description |
|---|---|
allow_float_down_convert |
Enables implicit conversion (e.g., f64 to f32). |
ndarray_15 |
Enables ndarray support for version 0.15.x. |
ndarray_16 |
Enables ndarray support for version 0.16.x. |
ndarray_17 |
Enables ndarray support for version 0.16.x. |
nalgebra_33 |
Enables nalgebra support for version 0.33.x. |
nalgebra_34 |
Enables nalgebra support for version 0.34.x. |