linux/rust/kernel/block/mq
Benno Lossin e832374cca rust: pin-init: change blanket impls for [Pin]Init and add one for Result<T, E>
Remove the error from the blanket implementations `impl<T, E> Init<T, E>
for T` (and also for `PinInit`). Add implementations for `Result<T, E>`.

This allows one to easily construct (un)conditional failing
initializers. It also improves the compatibility with APIs that do not
use pin-init, because users can supply a `Result<T, E>` to a  function
taking an `impl PinInit<T, E>`.

Suggested-by: Alice Ryhl <aliceryhl@google.com>
Link: 58612514b2
[ Also fix a compile error in block. - Benno ]
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/all/20250529081027.297648-2-lossin@kernel.org
[ Add title prefix `rust: pin-init`. - Benno ]
Signed-off-by: Benno Lossin <lossin@kernel.org>
2025-06-11 21:13:56 +02:00
..
gen_disk.rs rust: convert raw URLs to Markdown autolinks in comments 2025-05-12 00:20:25 +02:00
operations.rs rust: add build_error! to the prelude 2025-01-10 00:19:09 +01:00
raw_writer.rs rust: use custom FFI integer types 2024-11-10 23:58:00 +01:00
request.rs rust: block: refactor to use &raw mut 2025-03-23 20:39:37 +01:00
tag_set.rs rust: pin-init: change blanket impls for [Pin]Init and add one for Result<T, E> 2025-06-11 21:13:56 +02:00