O'Reilly logo

Mastering Rust by Vesa Kaihlavirta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10 - Unsafety and Interfacing with Other Languages

Rust has an unsafe mode which lifts the following restrictions: updating mutable static variables, accessing raw pointers, and calling unsafe functions. Unsafety can be requested for functions, blocks, traits, or implementations.

The typical case when unsafety is required is when interfacing with another language, such as using a library written in C from Rust.

For interfacing with other languages, there are several external crates, such as Ruru for interfacing with Ruby and Neon for JavaScript.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required