Poking @hansihe and @scrogson if that’s okay. Everybody else’s input is appreciated as well.
I need to return a Rust usize
variable and I am trying to do it like so:
let affected = ...; // a function that returns `usize`.
Ok((atoms::ok(), ResourceArc::new(affected)).encode(env))
I am getting this error (and a few more related to it):
error[E0277]: the trait bound `usize: rustler::resource::ResourceTypeProvider` is not satisfied
--> src/lib.rs:101:63
|
101 | Ok(affected) => Ok((atoms::ok(), ResourceArc::new(affected)).encode(env)),
| ^^^^^^^^ the trait `rustler::resource::ResourceTypeProvider` is not implemented for `usize`
|
= note: required by `rustler::ResourceArc::<T>::new`
I am at rustler 0.21.0.
Can you point me in the right direction?