Files
linux/rust
Alexandre Courbot 1db476d294 rust: transmute: add as_bytes method for AsBytes trait
Every type that implements `AsBytes` should be able to provide its byte
representation. Introduce the `as_bytes` method that returns the
implementer as a stream of bytes, and provide a default implementation
that should be suitable for any type that satisfies `AsBytes`'s safety
requirements.

[[email protected]: use fully qualified `core::mem::size_of_val` to
build with Rust 1.78.]

Reviewed-by: Danilo Krummrich <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
Acked-by: Miguel Ojeda <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Courbot <[email protected]>
2025-08-22 09:49:01 +09:00
..
2025-06-22 23:09:32 +02:00
2025-03-19 23:22:21 +01:00
2022-12-04 01:59:16 +01:00