Why Nostr? What is Njump?
2024-02-26 16:14:41

Ben Ramsey on Nostr: Is there an easier way to understand Rust’s built-in data structures. I’m reading ...

Is there an easier way to understand Rust’s built-in data structures.

I’m reading code, and I see `Box<T>` (where T is obviously some other type), so I ask, “What is a box data structure?”

I look it up, and the Rust docs say, “A pointer type that uniquely owns a heap allocation of type T.”

That could be any number of data types. Why is this one called “Box?” What does it do that’s different from other pointer types? Is it the fact that it’s “uniquely owned?” What does that mean in practice?
Author Public Key
npub1uef7kc9jmd0dlyrdx4xzsfdlqz5qm743k9mxektcq524ar7vpkesrejs23