Menu
Sign In Search Podcasts Charts People & Topics Add Podcast API Blog Pricing

Sebastian Scholz

๐Ÿ‘ค Speaker
485 total appearances

Appearances Over Time

Podcast Appearances

Rust in Production
Gama Space with Sebastian Scholz

You need to provide your own heap if you need it.

Rust in Production
Gama Space with Sebastian Scholz

And so you're very, very specific about the places that you need a heap.

Rust in Production
Gama Space with Sebastian Scholz

And you try to avoid it in all other cases.

Rust in Production
Gama Space with Sebastian Scholz

One thing that can help with that a lot is a crate called ZeroCopy, for example.

Rust in Production
Gama Space with Sebastian Scholz

In our telecommand and telemetry system, we use it very extensively.

Rust in Production
Gama Space with Sebastian Scholz

So the way it works is you define your structs, the data that you want to send, want to be able to send, and you use your copy to convert them or let them be converted safely into bytes and from bytes.

Rust in Production
Gama Space with Sebastian Scholz

without the use of an extra buffer, without the use of an extra allocation.

Rust in Production
Gama Space with Sebastian Scholz

Just the same amount of memory.

Rust in Production
Gama Space with Sebastian Scholz

It's basically a safe transmute, a safer transmute.

Rust in Production
Gama Space with Sebastian Scholz

And so, because we need to send the data as bytes, obviously.

Rust in Production
Gama Space with Sebastian Scholz

So we need to do this conversion to and from bytes.

Rust in Production
Gama Space with Sebastian Scholz

And zero copy is a great help for that sort of work.

Rust in Production
Gama Space with Sebastian Scholz

Yes, in a way.

Rust in Production
Gama Space with Sebastian Scholz

So there's two ways of using it.

Rust in Production
Gama Space with Sebastian Scholz

First of all, the easy way is you already have a struct and you want to convert it into bytes and send those bytes over the network.

Rust in Production
Gama Space with Sebastian Scholz

Zero copy helps you with that.

Rust in Production
Gama Space with Sebastian Scholz

But then the other way around is

Rust in Production
Gama Space with Sebastian Scholz

You receive a bunch of bytes and then you want to pass these bytes as a struct.

Rust in Production
Gama Space with Sebastian Scholz

And zero copy makes this passing, this conversion from just a view of the bytes into a reference to the actual struct possible and safe.

Rust in Production
Gama Space with Sebastian Scholz

by making sure that there's no invariants that can't be uphold.