- Hi, welcome to lesson 15.
In this lesson, we're going to dig a bit deeper
into Rust details and see some of its advanced topics
that it has in store for us.
We'll begin with a look at boxing.
In a nutshell, a box is a smart pointer
to an object allocated dynamically on heap.
We'll have a look at a simple example of boxing first,
then we'll see a more realistic example
of why you might use boxing in practice.
The next topic we look at is reference counting.
Rust defines a reference count construct, called RC,
that keeps count of how many references you have
to an object.
Each time a reference goes at a scope,
the counter is decremented.
And when the reference count goes to zero,
the underlying object is automatically deallocated.
Next up, we discuss the concept of unsafe code.
This is a mechanism that enables you
to bypass the normal protection offered by Rust
to perform low level operations,
such as accessing raw addresses in memory directly.
To finish off the lesson, we'll show how to integrate Rust
with other programming languages,
we'll see how to call other languages from Rust
and we'll also see how to make our Rust code callable
from other languages in the opposite direction.