Message ID | 20230331215053.585759-13-y86-dev@protonmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp866980vqo; Fri, 31 Mar 2023 15:05:35 -0700 (PDT) X-Google-Smtp-Source: AKy350awPHxdHH2DpymMrVzbotbKLOmKDM9yo9NSmDcBRxVWmykBXKCy1h/P3JCHn3co3oCtnb+h X-Received: by 2002:a17:902:ced0:b0:19f:1c69:54b5 with SMTP id d16-20020a170902ced000b0019f1c6954b5mr31432513plg.12.1680300335404; Fri, 31 Mar 2023 15:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680300335; cv=none; d=google.com; s=arc-20160816; b=MLA/CepGbPrpDB3K+GNz2GEbnld+yBYn6nYnRrpL5Ig6dNmSeWW+Dw2zlmMA7Kkomw t+YuO+p29ZclQizwH18ACgMnMy13FgP8kSaVf6U03/DJaOi6r2Z1srpXGHxrJuOhWaXo WJ7NYgDYonrXiYDka6qLXHo6i0UVxVNiPaq7Wam96DdeQofYvwRI3UepKLYnLvQmTuGo niarUZ9wBkCEMHfBMIkcbKB4u1Zkcaed8/hl11gdnPrLIk3yDD8SxS3hCatF4AFms3mg a5R3wvHDchJaZGWOZcksW0SLlB44v21eJHoM4SGXjBUgOoDOUXuHSwEeIO0qslw+LsPz kkMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:message-id:subject:cc:from:to:dkim-signature:date; bh=c1SYY0A1KylQEiGsgr7yJxl7OSG6W1YCjWLUakx2GG0=; b=NTLfERJ6d9Woa+vMinXKYHYayHHfKFMlCjnuKA/1BWj7X56eg/tdgf8K2IoA7/lvbf 38x5F0zgq8kcsOhPQ0LKNLPwPlcf9vOpsDHGQmUpcczWn11thaNozvXv/nhtMwLgou5H bbd9dr3jrIA6t5+KJMjM1T9VnQ67yboFNZiRimcBy+AK+soSiF8bUgEnGlNd8AmIy4CR SKPwDKjYiGhG12xw8gYueyDX86xq16C4b9iVqDEffgdf2xVgBq6idRBRlGalKFyNPWK+ eCloGrra7As67nqJCP59XIypoPt1cXXwQGU6ICpxPbtMwpVuap4RcINqXA/c75iYdYEr JVMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=ecaPmHSh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 7-20020a630707000000b00513946a0d18si3477641pgh.9.2023.03.31.15.04.58; Fri, 31 Mar 2023 15:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=ecaPmHSh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233316AbjCaV61 (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Fri, 31 Mar 2023 17:58:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbjCaV6Z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 31 Mar 2023 17:58:25 -0400 Received: from mail-4321.protonmail.ch (mail-4321.protonmail.ch [185.70.43.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8A5865A8; Fri, 31 Mar 2023 14:58:01 -0700 (PDT) Date: Fri, 31 Mar 2023 21:54:17 +0000 Authentication-Results: mail-4321.protonmail.ch; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="ecaPmHSh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1680299665; x=1680558865; bh=c1SYY0A1KylQEiGsgr7yJxl7OSG6W1YCjWLUakx2GG0=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=ecaPmHShyhmlyjowiPezN9aHf9KTDyMQu5g50xbfnkbXTq2q65c6pZj7jECrNgzpK upLffycjxrpuun1Gudt0U1QPUXxNVN5B8FSpLqOo7DVVbtFbe71e9ISuhabesxdL7O 8nkKN8xlmhhWgjhUmjJ6ZfDTEpyAug2603lIwxbmSW/CV2r73Hi/f8kZvGZeINyy11 WZl4upbV4yyycbZVz/ZH4UfUUBKeqXpaVb/zVVlVPDWLIUkTQFHzVLNo6T0PMRh8zB 8OwilGUr/Wcva3KDEbqgOFs/sD+3SCYEaLDXGlk7ZSAFsZB/Jlo9cqzDWjWgxqAu7u blNTI3gfJ7bzA== To: Miguel Ojeda <ojeda@kernel.org>, Alex Gaynor <alex.gaynor@gmail.com>, Wedson Almeida Filho <wedsonaf@gmail.com>, Boqun Feng <boqun.feng@gmail.com>, Gary Guo <gary@garyguo.net>, =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, Alice Ryhl <alice@ryhl.io> From: y86-dev@protonmail.com Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Benno Lossin <y86-dev@protonmail.com>, Alice Ryhl <aliceryhl@google.com>, Andreas Hindborg <a.hindborg@samsung.com> Subject: [PATCH v4 12/15] rust: prelude: add `pin-init` API items to prelude Message-ID: <20230331215053.585759-13-y86-dev@protonmail.com> Feedback-ID: 40624463:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761922604308770048?= X-GMAIL-MSGID: =?utf-8?q?1761922604308770048?= |
Series |
Rust pin-init API for pinned initialization of structs
|
|
Commit Message
y86-dev
March 31, 2023, 9:54 p.m. UTC
From: Benno Lossin <y86-dev@protonmail.com> Add `pin-init` API macros and traits to the prelude. Signed-off-by: Benno Lossin <y86-dev@protonmail.com> Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com> --- rust/kernel/prelude.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.39.2
diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs index 0bc1c97e5604..fcdc511d2ce8 100644 --- a/rust/kernel/prelude.rs +++ b/rust/kernel/prelude.rs @@ -18,7 +18,7 @@ pub use core::pin::Pin; pub use alloc::{boxed::Box, vec::Vec}; #[doc(no_inline)] -pub use macros::{module, vtable}; +pub use macros::{module, pin_data, pinned_drop, vtable}; pub use super::build_assert; @@ -27,8 +27,12 @@ pub use super::build_assert; pub use super::dbg; pub use super::{pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info, pr_notice, pr_warn}; +pub use super::{init, pin_init, try_init, try_pin_init}; + pub use super::static_assert; pub use super::error::{code::*, Error, Result}; pub use super::{str::CStr, ThisModule}; + +pub use super::init::{InPlaceInit, Init, PinInit};