Skip to content

Conversation

@samuelgja
Copy link

feat: add rkyv export support and convert back to native type

Summary

Add rkyv-gated helpers to convert archived half-precision types back to their native counterparts, and re-export the archived types from the crate root.

Changes

  • src/bfloat.rs

    • Under #[cfg(feature = "rkyv")], implement impl Archivedbf16:
      • Add pub fn to_native(&self) -> bf16 to convert the archived value back to bf16.
  • src/binary16.rs

    • Under #[cfg(feature = "rkyv")], implement impl Archivedf16:
      • Add pub fn to_native(&self) -> f16 to convert the archived value back to f16.
  • src/lib.rs

    • Under #[cfg(feature = "rkyv")]:
      • Re-export bfloat::Archivedbf16.
      • Re-export binary16::Archivedf16.

Motivation

These helpers make it easier to round-trip bf16/f16 when using rkyv, and the root re-exports improve ergonomics by exposing the archived types alongside their native counterparts.

@samuelgja samuelgja force-pushed the feat/rkyv-archived-export branch from fe9c74e to ab680cd Compare November 14, 2025 11:37
@samuelgja samuelgja force-pushed the feat/rkyv-archived-export branch from ab680cd to 9a4c741 Compare November 14, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant