# Lokathor/bytemuck

A crate for mucking around with piles of bytes

Repository: https://github.com/Lokathor/bytemuck
Canonical: https://ross.abutalabs.com/products/bytemuck
Homepage: https://docs.rs/bytemuck
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: rust, zlib-license
Last push: 2026-08-07T04:42:05+00:00

## Health v2 (maintenance only)
Score: 75/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 35, longevity 100
- inputs: {"age_days": 2540, "days_push": 26, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1049, forks 111 (observed 2026-08-28T04:03:22.648055+00:00)

## What it is
A Rust library for safely bit-casting (transmuting) between plain data types and byte slices, with traits like Pod, NoUninit, and AnyBitPattern to enforce memory safety. It is widely used to reinterpret slices of structs as raw bytes, e.g. for sending vertex data to the GPU.

## Use cases
- cast a slice of structs to bytes for uploading to the GPU
- safely transmute between plain data types in Rust
- reinterpret a byte buffer as a different type
- zero-copy serialization of plain-old-data structs
- convert between u8 slices and typed slices
- derive Pod/Zeroable traits for my structs

## When to choose
- you need to reinterpret memory between types without copying
- you're preparing vertex or uniform data for graphics APIs like wgpu
- you want checked or must-cast transmutes with safety traits instead of raw unsafe transmute
- you need a tiny, stable, no_std-friendly dependency

## When to avoid
- your types contain pointers, references, or heap data (not plain old data)
- you need general serialization to portable formats like JSON or protobuf
- you only need simple numeric conversions that the `as` keyword or From/Into already handle

## Facets
- artifact type: library
- maturity: stable
- function: serialization, developer-tools
- domain: developer-tools, graphics, programming-languages
- platform: rust, cross-platform, wasm
- tags: bit-casting, transmute, pod, zero-copy, gpu-data, unsafe-rust, bytes

## Member repositories
- Lokathor/bytemuck (main) score 75

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:22.648055+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:00:27.286799+00:00, confidence not recorded.
  - readme: https://github.com/Lokathor/bytemuck (fetched 2026-08-28T04:03:22.648055+00:00, sha a3f6dd28e550)
  - homepage: https://docs.rs/bytemuck (fetched 2026-08-29T13:01:50.009156+00:00, sha 41b2a2278e67)
  - site_page: https://docs.rs/ (fetched 2026-08-29T13:01:50.018377+00:00, sha f4444a44113e)
  - site_page: https://docs.rs/crate/bytemuck/latest (fetched 2026-08-29T13:01:50.020310+00:00, sha 35afdbaa5411)
  - site_page: https://docs.rs/crate/bytemuck/latest/features (fetched 2026-08-29T13:01:50.022244+00:00, sha 7f8a20d88f74)
  - site_page: https://docs.rs/about (fetched 2026-08-29T13:01:50.023899+00:00, sha 29ab7986fbf5)
  - site_page: https://docs.rs/about/badges (fetched 2026-08-29T13:01:50.025454+00:00, sha 6588cac258af)
  - site_page: https://docs.rs/about/builds (fetched 2026-08-29T13:01:50.027042+00:00, sha 811231ca4680)
  - site_page: https://docs.rs/about/metadata (fetched 2026-08-29T13:01:50.028752+00:00, sha 0dcdccb2b2b2)
  - site_page: https://docs.rs/about/redirections (fetched 2026-08-29T13:01:50.030291+00:00, sha 1b1efd93105f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
