Message ID | 20230408122429.1103522-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 b10csp844178vqo; Sat, 8 Apr 2023 05:28:21 -0700 (PDT) X-Google-Smtp-Source: AKy350akeTIWLO9VliZWORrKO0gDltFWfKzgzNNENIkJ/0V9jVHEIAx3e+oiq2tz8+8pZmvbdZuK X-Received: by 2002:a17:902:d509:b0:1a1:b7fc:eeba with SMTP id b9-20020a170902d50900b001a1b7fceebamr2493418plg.19.1680956901518; Sat, 08 Apr 2023 05:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680956901; cv=none; d=google.com; s=arc-20160816; b=w6VsyHDlOmg2UyunsutA1VdwmitMZi2c7mNtYo+eGpTACKXBfLT162sYdoOrg8ktvC zynWX0mqEaJYnM2PmEKTzShKRe9wWnHMq/0xTRe7UE7fu4s75IhrzBF+1tfSp8yu1TKr BwqXE6w80e8iVp3C04FPLu+LG6Obbuu2Msrkiths7WsNZehm9OcdbVT8IKhySr/I+TTT 1cE6RrgqYXgwkJMqguP7GpQXI81wqJZBVzRP+sOQtk2snZoQxQ2/e8N3yxwjLXBFkKta FO9llmVpQvaCIBSYBqMDzbDg9EZckmdk5HJYdCysbwRf+FndFiY7ERGlfrX7ZEpb7blI 4urg== 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:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=gdEIW+2bBi1IvDlMbXGasea4+ibnJ2p7QwfZLUN+zQA=; b=PaokpqO1uz8boi2E2fUwKzvDjbdg5+lQJC2iWuCsnrE01GiUw12akTozBGy7NzZcqi ZZevrOJVRqjeOJm4ShRWhcvrxSIO7xdWTmiCMnyDWndGwCLPsbEJkFgT5Fp1+NfRZu6n A4uCawLSP4wLHobz4+8pDE/ZtcrjchsFKOug5s6GU4SutfVFtbt7pOpDyAuS7fnn1WBE KwKwF1WzOgnEtrg+MJ7MgmRk3QBVqOGhUSna8owm9OImfmTEnszZKDS5bmODWfLEcT4c AyE0PFTGaV6D3BZ+dKY7HrQxfTWiTOsRWqR+JBlyPL69kyQBZ95LwdIJmg2E7rM0Sy3v Lt6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=pIADBwX0; 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 n13-20020a170903110d00b001992f451a28si6655847plh.384.2023.04.08.05.28.08; Sat, 08 Apr 2023 05:28:21 -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=pIADBwX0; 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 S231396AbjDHM10 (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Sat, 8 Apr 2023 08:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231279AbjDHM1E (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 8 Apr 2023 08:27:04 -0400 Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85D26EFA7 for <linux-kernel@vger.kernel.org>; Sat, 8 Apr 2023 05:26:43 -0700 (PDT) Date: Sat, 08 Apr 2023 12:26:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1680956785; x=1681215985; bh=gdEIW+2bBi1IvDlMbXGasea4+ibnJ2p7QwfZLUN+zQA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=pIADBwX0173PFfDAF4r8e2kpng9MOS+XfnmIhLloRySMWkhT+hJFIwVqFCm70SlFk xe8aSwoKIBu9UndZ3hjYZWZab6m4Uw/3fjqRa/aq7mAP6Iia/pJC4YcxaZAvjKrRiM 13cqLprzI5htvsV8Qw03OTT/UxKhiqAYGp2O97EZ5OljSLHnNe1qMAKD87bZNhh3od pmMg0i2DbTTf/ocozFq7m+EFrT3ditbd6+EOODeSDnhZpo50KppqBzNJR0lSSDzOos m2lC4i4s3hwan7lUlWo3DbTS3z1WVJUwSq/VbL7qnN1KTH9fM45gKIMe7/peaq6Ep8 CC1NDL05UAKXg== 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>, Andreas Hindborg <nmi@metaspace.dk> From: Benno Lossin <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 v7 12/15] rust: prelude: add `pin-init` API items to prelude Message-ID: <20230408122429.1103522-13-y86-dev@protonmail.com> In-Reply-To: <20230408122429.1103522-1-y86-dev@protonmail.com> References: <20230408122429.1103522-1-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,RCVD_IN_MSPIKE_H2, 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?1762611063861399248?= X-GMAIL-MSGID: =?utf-8?q?1762611063861399248?= |
Series |
Rust pin-init API for pinned initialization of structs
|
|
Commit Message
y86-dev
April 8, 2023, 12:26 p.m. UTC
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};