]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rust: prelude: add `zerocopy{,_derive}::FromBytes`
authorMiguel Ojeda <ojeda@kernel.org>
Mon, 8 Jun 2026 14:14:37 +0000 (16:14 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 9 Jun 2026 02:13:23 +0000 (04:13 +0200)
In order to easily use `FromBytes`, add it to the prelude.

This adds both the trait (`zerocopy::FromBytes`) as well as the derive
macro (`zerocopy_derive::FromBytes`).

We will be adding more as we need them.

Link: https://patch.msgid.link/20260608141439.182634-19-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/prelude.rs

index bcd4e7f90bc72d01987be42bf663298544354194..ca260cc3937a8884609ebe5ed88083827b59b451 100644 (file)
@@ -60,6 +60,12 @@ pub use pin_init::{
     Zeroable, //
 };
 
+#[doc(no_inline)]
+pub use zerocopy::FromBytes;
+
+#[doc(no_inline)]
+pub use zerocopy_derive::FromBytes;
+
 #[doc(no_inline)]
 pub use super::{
     alloc::{