I've implemented a way to store a type erased object instance with all associated traits and probably committed some crimes along the way

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/rust

Our great sponsors
  • SonarQube - Static code analysis for 29 languages.
  • Scout APM - Less time debugging, more time building
  • SaaSHub - Software Alternatives and Reviews
  • multi-trait-object

    A rust type to store an object with all associated traits

  • rfcs

    RFCs for changes to Rust

    While this works, it is arguably not "safe," because there are no stability guarantees about the layout of fat pointers. Which is to say, rustc is permitted to silently change the layout of trait objects or other fat pointers at any time, making the transmute between a trait object and your FatPointer type unsound. The layout of trait objects has never changed thus far, but there are real proposals that would involve doing so (for example), and the layout is explicitly undefined for this reason.

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • rust

    Empowering everyone to build reliable and efficient software.

    The only way to interact with pointer metadata like this in a way that could be considered safe is through the ptr-metadata API, which is itself unstable and feature-gated (although an RFC has been merged, so I believe it is on a path to stabilization.)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts