#array #serialization #serde #macro #proc-macro

macro structurray

Easy psuedo-array generation for database optimization

1 unstable release

0.1.0 Jul 6, 2024

#1939 in Data structures

Apache-2.0

11KB
59 lines

Structurray

A Rust Library designed to help create structs that store many values of the same type. These structures, or psuedo-arrays, are useful for increasing storage efficiency in Google Firebase (realtime database) or other environments that store data as a string-like object but do not support arrays. This is because Structurray uses a Base62 algorithm, as outlined in the documentation of ascii_basing, to reduce the length of identifiers compared to the base-10 naming algorithm usually used by default.

For more information about this library, check its documentation.


lib.rs:

Psuedo-Array Generation

This crate allows for the generation of structs with an arbitrary, programmer-provided number (less than u32::MAX) of identical fields with different names. Generally speaking, it is also useful to use another crate, structinator, on large structs generated with this crate to allow your struct to be automatically constructed from an Iterator.

Psuedo-Array structs like this are ideal for reducing data spent on identifiers in online databases like Google Firebase.

To learn more about what this crate does, look at the documentation for this crates only public attribute, [macro@faux_array].

Dependencies

~290–740KB
~17K SLoC