UsefulLinks
1. Getting Started with Rust
2. Rust Fundamentals
3. Understanding Ownership
4. Structuring Data with Structs
5. Enums and Pattern Matching
6. Managing Growing Projects
7. Common Collections
8. Error Handling
9. Generic Types, Traits, and Lifetimes
10. Writing Automated Tests
11. Functional Programming Features
12. Smart Pointers
13. Fearless Concurrency
14. Advanced Features
15. Foreign Function Interface
16. Rust Patterns and Best Practices
  1. Computer Science
  2. Programming
  3. By Language

Rust Programming

1. Getting Started with Rust
2. Rust Fundamentals
3. Understanding Ownership
4. Structuring Data with Structs
5. Enums and Pattern Matching
6. Managing Growing Projects
7. Common Collections
8. Error Handling
9. Generic Types, Traits, and Lifetimes
10. Writing Automated Tests
11. Functional Programming Features
12. Smart Pointers
13. Fearless Concurrency
14. Advanced Features
15. Foreign Function Interface
16. Rust Patterns and Best Practices
15.
Foreign Function Interface
15.1.
FFI Fundamentals
15.1.1.
C ABI Compatibility
15.1.2.
Memory Layout Considerations
15.1.3.
Safety Boundaries
15.2.
Calling C from Rust
15.2.1.
extern Blocks
15.2.2.
Function Declarations
15.2.3.
Linking External Libraries
15.2.4.
Header File Translation
15.3.
Data Type Mapping
15.3.1.
Primitive Type Mapping
15.3.2.
Pointer Types
15.3.3.
Struct Layout
15.3.4.
Enum Representation
15.4.
Calling Rust from C
15.4.1.
extern "C" Functions
15.4.2.
#[no_mangle] Attribute
15.4.3.
C Header Generation
15.4.4.
Library Creation
15.5.
Memory Management in FFI
15.5.1.
Ownership Transfer
15.5.2.
Memory Allocation
15.5.3.
String Handling
15.5.4.
Error Propagation
15.6.
Build System Integration
15.6.1.
build.rs Scripts
15.6.2.
cc Crate Usage
15.6.3.
pkg-config Integration

Previous

14. Advanced Features

Go to top

Next

16. Rust Patterns and Best Practices

About•Terms of Service•Privacy Policy•
Bluesky•X.com

© 2025 UsefulLinks. All rights reserved.