Files
linux/rust/kernel
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-07-23 02:05:58 +02:00
2025-07-23 02:05:58 +02:00
2025-07-21 01:16:35 +02:00
2025-07-19 23:18:18 +02:00
…
2024-10-08 15:44:36 +02:00
2025-07-21 01:16:35 +02:00
2024-11-04 16:21:44 -05:00