Cranston's Life - Rust and More Rust

Calling Rust Functions from C Code!

I have read an article called writing c library in rust.

It has a simple example of how one can write code in Rust and then CALL that Rust code from C code.

Some Rust code is written that implements a FUNCTION.

The Rust code is compiled and built into a STATIC LIBRARY.

cbindgen is used to generate a C HEADER FILE.

The C header file is included into some C code that CALLS the function that was written in Rust.

This example is simple but I think it shows the steps and I think it is a very CLEAR example that I could follow with the utmost of ease.

I must LEARN MORE about writing functions in Rust and then calling them from C code!