Calling Rust from NodeJS
The short answer: you cannot export any Rust function for FFI bindings, you need to specifically export Rust functions compatible with C.
Specifically, this means that you need to expose only C-struct compatible objects OR expose opaque pointers (which can only be manipulated through Rust functions).
In your case, Vec<Post>
is not compatible with usage in FFI, because Vec
is not.
You can find more information in the FFI Guide.