Message ID | 20230403160511.174894-5-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 b10csp2419678vqo; Mon, 3 Apr 2023 09:14:55 -0700 (PDT) X-Google-Smtp-Source: AK7set9goozNse/Wr6nV2IjyJmPdphOT28NDVaJKPig7Xqdb+cTUy7J7hTqMSdPT+QpuomOeE7PW X-Received: by 2002:a05:6a20:b704:b0:dd:cef1:93e4 with SMTP id fg4-20020a056a20b70400b000ddcef193e4mr27918697pzb.14.1680538495050; Mon, 03 Apr 2023 09:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680538495; cv=none; d=google.com; s=arc-20160816; b=lAF2HmvHn1U9P4pVun+J/5i6geb6Q5SBRLFnpYJVFAjfgA15ndwBvLQXIEJCF4IhTC REijCk7Ilc1MVGSQR3Q0k+i3Ew/ZXWau0NT9DqqPaBDSrTUstg8J+8v/BsMH7EETew3h bt3IUnohhwtIxrN3JVvPSKI5o1PLe9Dn9Wwix+cavuNULESD/IJ+OV3+An1lEGEuOVai KpFMoFzO7ChIb1h6xh5ElLpY+90qOg8BjjEFQKzOlZQk/Fy1JeMxgk69KpNI1Iybb/s+ JY8wZJNkaitvdviAD/XfIXy2o4RlHLUKgci3+zwuKE+qb2NS2+2JeWxftBC6bO8ztNbw uNKQ== 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=w9FGiqgUru3DBgRzQ4ttcZTJQBJfk2DZ+3D5Pm7aTQIQowjAxN0w5Szf7nC2P3iAs4 R3z4uiEb0GKRxGmfRKZFhhU2Nr9sThC8dDdilDdga/HpdO+Kq96e1ADqfU4vPcqVPQpI 2ZnLleUPzWJn708hmGy5xjLEJf4aBFKNHpEC6710hgedqtt0zZ7oVn8pJvdMjBFr9K0E zBH5xQwYmt1YDthbjrROjZxoBp2/6Z1HwZkl4F4XrLPp72uW88H9JUEvZ2HeWKCwf0t4 pbG15ip846zf3UYliZrgeEwwyoWb7RsX0ilJFVoyGVNxxGxCEhWnVI6b4HtqgDm8qJJd YAlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=CAT4FcRP; 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 r9-20020aa79889000000b00625dc9792a6si8475478pfl.300.2023.04.03.09.14.41; Mon, 03 Apr 2023 09:14:55 -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=CAT4FcRP; 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 S233276AbjDCQGO (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Mon, 3 Apr 2023 12:06:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233176AbjDCQGF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 3 Apr 2023 12:06:05 -0400 Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAFA73581; Mon, 3 Apr 2023 09:05:57 -0700 (PDT) Date: Mon, 03 Apr 2023 16:05:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1680537955; x=1680797155; 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=CAT4FcRPTKXOD8ELZ4PLIVsTI8iHWhIEqw0uBQFS3y6BZnwwTLJwQ7fiDy6R+tLAd 2DJ3X5zs/GaB3jmr4rDHPa6+6fFiN3uly5OXYGngjr+IjKkcXvwA/AerUMkMggtyFJ CbWXUj0EY1BpWheiee5gIAXGz24jy1OG2cYe+FxVxaRaglMMvVnv81xIr1B+1aD6mk XIQPbTa0KANgDd5lFa8swL1iqs0KIDXbkkXfqqCFPqH+DesWaSkGUu+LlEA7PKxCY/ 3RcAwXC+760CUYQF6jW0zLghHzVBLDBOMRYPyKKNKeU5fnOj0fbtbDG++vyzUFda1Q 8VaCwQojdAjWg== 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: 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 v5 12/15] rust: prelude: add `pin-init` API items to prelude Message-ID: <20230403160511.174894-5-y86-dev@protonmail.com> In-Reply-To: <20230403154422.168633-1-y86-dev@protonmail.com> References: <20230403154422.168633-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?1762172332937192606?= X-GMAIL-MSGID: =?utf-8?q?1762172332937192606?= |
Series |
Rust pin-init API for pinned initialization of structs
|
|
Commit Message
y86-dev
April 3, 2023, 4:05 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};