3 ms·
> you can't (or don't want to) allocate memory dynamically. this crate is intended to allow all metrics storage to be declared in statics, for use in embedded s
by eldenring 4y ago
> you can't (or don't want to) allocate memory dynamically. this crate is intended to allow all metrics storage to be declared in statics, for use in embedded systems and other no-std use-cases.
Basically, the library just transforms over a statically assigned buffer.
In a lot of languages, this means you lose out on some language features, but I believe features like pattern matching are alloc free in rust.
- cormacrelf 4y agoMore accurately for a lot of languages you can’t make them allocation free. Rust put all of the parts of the standard library that allocate in one crate, called alloc, and that crate is optional (but included in std, so opt-out). Platforms that don’t have an allocator don’t have the alloc crate. So you are forced to select dependencies like this one that will compile without it. Language features like pattern matching are not affected.This is about standard library features. You don’t get Vec or String without the alloc crate.