rust: pin-init: add `cast_[pin_]init` functions to change the initialized type
authorBenno Lossin <benno.lossin@proton.me>
Mon, 21 Apr 2025 22:17:50 +0000 (22:17 +0000)
committerBenno Lossin <benno.lossin@proton.me>
Thu, 1 May 2025 16:08:52 +0000 (18:08 +0200)
commit90348980a305cc24a067cc6e606e1c318e277930
tree4bcea488916abdf4bc972799b33cb43b743b682d
parent39051adb070432b283e6c11b2b24937281b9f97f
rust: pin-init: add `cast_[pin_]init` functions to change the initialized type

These functions cast the given pointer from one type to another. They
are particularly useful when initializing transparent wrapper types.

Link: https://github.com/Rust-for-Linux/pin-init/pull/39/commits/80c03ddee41b154f1099fd8cc7c2bbd8c80af0ad
Reviewed-by: Christian Schrefl <chrisi.schrefl@gmail.com>
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
rust/pin-init/src/lib.rs