News for hackers. Stuff that matters.
Re:Untapped potential in Rust's type system by Hywan on Monday June 14, 2021 @10:08AM (#27502686)
At my work, we have developped `loupe`, a Rust crate that does precisely that, https://github.com/wasmerio/loupe/. I'm the main author of it.

`loupe` provides the `MemoryUsage` trait; It allows to know the size of a value in bytes, recursively. So it traverses most of the types, and its fields or variants as deep as possible. Hopefully, it tracks already visited values so that it doesn't enter an infinite loupe loop.

We are using it inside Wasmer, a WebAssembly runtime.

There are no comments on this comment yet.