How memory-safe programming in Rust can complicate the design of data structures:, via and

Data structures cannot have circular references, so if you need them you can either fall back to non-memory-safe techniques (reference counting or unsafe blocks) or make your top-level structure implement its own memory allocator and refer to everything by indexes into its vector of objects instead of by proper references.

· · Web · 0 · 0 · 0
Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!