Why does Rust bindgen have bitfields?

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

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • go

    The Go programming language

  • How does Golang deal with this? It doesn't. And to be fair, Rust doesn't either.

  • rfcs

    RFCs for changes to Rust

  • How does Golang deal with this? It doesn't. And to be fair, Rust doesn't either.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • rust-bindgen

    Automatically generates Rust FFI bindings to C (and some C++) libraries.

  • But then why does bindgen attempt to have bitfields at all. Yes, I see the unsafe but wouldn't it be "safer" to recommend exporting C helper getter/setter functions to deal with this? I actually don't understand how any crate can say they have "C-compatible" bitfields.

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

  • Security vulnerability in Rust standard library

    4 projects | news.ycombinator.com | 21 Jan 2022
  • Go’ing Insane: Endless Error Handling

    5 projects | news.ycombinator.com | 14 Sep 2021
  • 7 Programming Languages Every Cloud Engineer Should Know in 2024!

    4 projects | dev.to | 5 Mar 2024
  • Why stdout is faster than stderr?

    2 projects | news.ycombinator.com | 10 Jan 2024
  • Odin Programming Language

    23 projects | news.ycombinator.com | 1 Jan 2024