Rustler: how to return an `usize` variable?

As I responded on IRC…resources only work with structs and must be accompanied with the rustler::resource_struct_init! macro (in 0.21) or rustler::resource! (in 0.22).

In order to make this work, you’ll need to make a new type which wraps the usize like so:

struct Affected(usize)