1. 1. Introduction
    ❱
    1. 1.1. Quickstart
  2. 2. Detailed usage
    ❱
    1. 2.1. Cargo.toml
    2. 2.2. src/lib.rs and header generation
    3. 2.3. Custom types
  3. 3. Motivation: safer types across FFI
    ❱
    1. 3.1. The limits of traditional FFI
    2. 3.2. Defined layout for Rust's pervasive types
  4. 4. Simple examples
    ❱
    1. 4.1. string_concat
    2. 4.2. Maximum member of an array
  5. 5. ReprC and #[derive_ReprC]
    ❱
    1. 5.1. On a struct
    2. 5.2. On an enum
  6. 6. #[ffi_export]
    ❱
    1. 6.1. Auto-generated checks
    2. 6.2. Attributes
  7. 7. Callbacks
    ❱
    1. 7.1. Function pointers
    2. 7.2. Closures
  8. 8. dyn Traits / Virtual objects
    ❱
    1. 8.1. VirtualPtr<dyn Trait>
    2. 8.2. #[derive_ReprC(dyn, …)]
    3. 8.3. Example: FFI-safe Futures and executors
  9. 9. Example: Real-world use case at Ditto
  10. 10. Example: our own hashmap in C
  11. Appendix: FFI and C compilation
  12. Appendix: how does safer_ffi work
Sponsored by

`safer_ffi` User Guide

Real-world example at Ditto-logo

ditto-logo-no-title See our blog post ditto-logo-no-title