EmbeddingGemma 2: an open, lightweight multimodal embedding model
deepmind.google·6d ago
TL;DR
New Rust traits will allow types to opt out of being moved or forgotten, enhancing memory safety and enabling features like scoped spawn and async drop.
✦ Why It Matters
Explore the new traits in Rust to enhance memory safety in your projects today.
Key Takeaways
How It Works
The Move trait allows types to declare they cannot be moved, simplifying the handling of immovable types. This contrasts with the current Pin mechanism, which complicates the language by treating immovability as a property of memory locations rather than types.
The Forget trait ensures that destructors run, enabling safe scoped spawning of async tasks by preventing handles from being forgotten.
Related