Library crate

Aside from having a main function, it is also possible to up your project as a cdylib project. In order to do that, add the following to your Cargo.toml:

crate-type = ["cdylib", "rlib"]

And then, define the entrypoint in your like (does not need to be async):

fn main() {
pub async fn run() {}