rust: types: add `Opaque` type
authorWedson Almeida Filho <wedsonaf@gmail.com>
Thu, 10 Nov 2022 16:41:40 +0000 (17:41 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 4 Dec 2022 00:59:16 +0000 (01:59 +0100)
commitb9ecf9b9ac5969d7b7ea786ce5c76e24246df2c5
tree745d370ce35c2004b4929733476add3f1a0a0850
parentba20915bae49024dab6ee582abdd4cd8944a3e55
rust: types: add `Opaque` type

Add the `Opaque` type, which is meant to be used with FFI objects
that are never interpreted by Rust code, e.g.:

    struct Waiter {
        completion: Opaque<bindings::completion>,
        next: *mut Waiter,
    }

It has the advantage that the objects don't have to be
zero-initialised before calling their init functions, making
the code performance closer to C.

Signed-off-by: Wedson Almeida Filho <wedsonaf@gmail.com>
[Reworded, adapted for upstream and applied latest changes]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/types.rs