Serde and const generic arrays

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

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • serde

    Serialization framework for Rust

  • Recently I needed to be able to deserialize/serialize a struct that contained a [f64; N] const generic array. After some errors and some Googling, I eventually found that Serde can't handle these (nor even regular arrays with a size greater than 32). So with the help of Serde's excellent documentation, and much trial-and-error (oh! so much error!), I managed to put together a simple library that allows you to serialize not only const generic arrays, but arrays of any size!

  • serde_arrays

    A simple module to support serializing and deserializing const generic or arbitrarily-large arrays

  • I've created an issue for your use case. Unfortunately all I've managed to accomplish today is proving that it's impossible, outside of Serde implementing it themselves, to handle arbitrary levels of nesting, which is what I was hoping to do. Thus a separate module has to be implemented for each such collection.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • semver-trick

    How to avoid complicated coordinated upgrades

  • From a language/cargo point of view, there is no issue. But the issue arises when you look at the ecosystem. It's really well explained in the semver-trick readme. semver-trick isn't a complete solution to the problem, but rather equivalent to a band-aid (or a hack).

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