lkml.org 
[lkml]   [2023]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 07/15] rust: init: add initialization macros
On 4/3/23 17:45, Benno Lossin wrote:
> Add the following initializer macros:
> - `#[pin_data]` to annotate structurally pinned fields of structs,
> needed for `pin_init!` and `try_pin_init!` to select the correct
> initializer of fields.
> - `pin_init!` create a pin-initializer for a struct with the
> `Infallible` error type.
> - `try_pin_init!` create a pin-initializer for a struct with a custom
> error type (`kernel::error::Error` is the default).
> - `init!` create an in-place-initializer for a struct with the
> `Infallible` error type.
> - `try_init!` create an in-place-initializer for a struct with a custom
> error type (`kernel::error::Error` is the default).
>
> Also add their needed internal helper traits and structs.
>
> Co-developed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Benno Lossin <y86-dev@protonmail.com>
> Cc: Alice Ryhl <aliceryhl@google.com>
> Cc: Andreas Hindborg <a.hindborg@samsung.com>

Reviewed-by: Alice Ryhl <aliceryhl@google.com>

\
 
 \ /
  Last update: 2023-04-03 19:57    [W:0.837 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site