Rust theorytheory 0/50 · 0%
Systems · hard

39. FFI and no_std

Talking to C and running bare metal.

`extern "C"` plus #[repr(C)] enables calling and being called by C, with bindgen and cbindgen generating headers. `#![no_std]` drops the standard library for embedded and on-chain targets, keeping core and optionally alloc.

Check your understanding

  1. 1. Which attribute fixes struct layout for FFI?

  2. 2. no_std keeps which crate?