Skip to content

Commit

Permalink
Add more getting started documentation, fixes #116.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfbiedert committed Oct 5, 2024
1 parent 87ddbc0 commit 19ed3ff
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@
//! - **understand what's possible**, see the [**reference project**](https://github.com/ralfbiedert/interoptopus/tree/master/reference_project/src),
//! - **support a new language**, [**copy the C backend**](https://github.com/ralfbiedert/interoptopus/tree/master/backends/c).
//!
//! For a "production-ready" project you generally want to follow these 3 steps:
//!
//! - Write a Rust crate, such as `my_library` and solve your problem in a Rust-idiomatic way.
//! - Add a crate `my_library_ffi`, which holds interop types and C-style definitions for your library similar to the examples above.
//! - For example, for a `my_library::Container` you probably want to a FFI sibling `my_library_ffi::Container`.
//! - While this might seem like extra work (it is) it gives you fine-grained access to what you expose. Once your project reaches a certain size, this will be invaluable.
//! - You'll probably want to add some conversion methods between your types, and FFI exposed methods to allow your interop users
//! to interact with these types in a controlled fashion.
//! - Add a crate `my_library_interop`. Inside there reference the backends for which you want to create interop definitions
//! (either in some unit tests, a `main.rs` or `build.rs`), and invoke the interop generation when needed; again, compare examples above.
//!
//!
//! ## Supported Rust Constructs
//!
Expand Down

0 comments on commit 19ed3ff

Please sign in to comment.