From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 777212253E1 for ; Mon, 10 Mar 2025 09:50:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741600208; cv=none; b=BSz4wp4kTvPnEX2SUU5oaWiGgXuwPjb4r21LegRpuhvx+WIkhK735X/bcuDLI3z87cnqz/gHtNl824wdlCpW0xN8EIK3Pig9/1iENXQDuABH/UV85bAmgljw5dRQQiiF//qXeAv12zsuND4n2UBhXaN5NiXGn3CqEE8munYsciU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741600208; c=relaxed/simple; bh=li9maBtZYH0WSwQ7I4Sx8a2w/PrJcS0hZ8B1pMYw794=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XJYuMCH7Dlwqd9rNt/myeysIqR8IepA0I2Dv6zLcZjYpvQFyFq/i1QVADra57CECr4aw/lr3rsa5vCjPpLv81u1YqRbVEJzRKltRg3m1Ea/e5ZzZIjC9o4lbei/L2pm0NJRPf1xjHvlPJ3GGFwnO0ggHOFaIY2oMkTN1Me0CcR8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=BsKuJzZg; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="BsKuJzZg" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-43cf5196c25so4090625e9.0 for ; Mon, 10 Mar 2025 02:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1741600205; x=1742205005; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=zayc4ME8ub10z847YBIo2OSP/R7y2OfUd/FH2hrf0YE=; b=BsKuJzZgNkMN0gd1ldRnao7dettc3eGf/7vIIodjJYuAbZG7YPu9881ujBtpDvHaWl PycahbH5cEMd7VP+CXIBku3jnPe4vQrHML8r8AjUe0tNxPYd6G2knFp1tdYpwODjYdSw DtrnZA1AG7pgpZ2E3T+5H9sT0v02/W4CR4N55PmrJZZQiXDiFQW8I4XUl7M6m1bHxP3l uRLg1Ss8N9vPuspEilaBC1lcdYKm5yAMqZbU6rE+2PiO5IPemGbZ7++Z7I2gHaW03e9V TOxCUbigJgGdpkVe2qcAuEjy0Szz1TXkuxYwPFwTEqLoRsMsC6XYMM9kLPIEeXgFAy6C gU7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741600205; x=1742205005; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zayc4ME8ub10z847YBIo2OSP/R7y2OfUd/FH2hrf0YE=; b=G1SRw5eBNTyQ5OWjd9H//c3INhJ1UuhAG2KJzv5uFeQn/hiGF14Zy0f11gsWg+qwMJ iFGFZNalRJqs7Hm05BZ35DhL5wdcyp/t/HunMlzzMTxdd3b0pG+1D7bW7mr2JDw5j4VP dts1FG5ppv0G0KCSEuy+u/O5EK3lt8F7EsPR7kN8LYE5l04RjlvtXz/8pouFVZoekwoz S7YD8RVK6nmjeAGcNCjuvSQkWvLGV+y5qqPRgjKtUErpiL98jY9dGWFmdVHbNZvYhhXe waXbQHk+DesqojqtuZ/seP1bWRzoGneB7TTqFTeXQKiGNotgEVugpJjzVO0XCVLTlvJC +EpQ== X-Forwarded-Encrypted: i=1; AJvYcCUeYimCVq/fzXHtg7hQ167eYWTzH/qqwnOyX4hMM7tQX8aMqLzGLg3fFY+V4xEymp5J8W1p+3WnQlQNDlS4fQ==@vger.kernel.org X-Gm-Message-State: AOJu0YywjZ9cpmiOW58krrC1xpMnzmgYvpLzdHZQKD16rZHO+S7a65WA npQTDhY4TsZKcZ8/ugU+Wmu3Rze38D9rZvyn3mBl55+4CEhHXsO02GpKdQ5KREgq0nQ1iciQf4J I/QN+U4UaMivQtA== X-Google-Smtp-Source: AGHT+IFh6zDOg5JSQ5hBks5Kv2fA7ferdFCU+xaQli8NpPVCQgSZ8GXEKmfHPKiJ2GFqReRUcUZjB4F9g1Vim14= X-Received: from wmgg17.prod.google.com ([2002:a05:600d:11:b0:43b:c336:7b29]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:474c:b0:434:fb65:ebbb with SMTP id 5b1f17b1804b1-43c5a6116f2mr81052195e9.17.1741600205067; Mon, 10 Mar 2025 02:50:05 -0700 (PDT) Date: Mon, 10 Mar 2025 09:50:02 +0000 In-Reply-To: <20250310-unique-ref-v6-1-1ff53558617e@pm.me> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250310-unique-ref-v6-0-1ff53558617e@pm.me> <20250310-unique-ref-v6-1-1ff53558617e@pm.me> Message-ID: Subject: Re: [PATCH v6 1/5] rust: types: Add Ownable/Owned types From: Alice Ryhl To: Oliver Mangold Cc: Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Asahi Lina , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Mon, Mar 10, 2025 at 08:49:43AM +0000, Oliver Mangold wrote: > From: Asahi Lina > > By analogy to AlwaysRefCounted and ARef, an Ownable type is a (typically > C FFI) type that *may* be owned by Rust, but need not be. Unlike > AlwaysRefCounted, this mechanism expects the reference to be unique > within Rust, and does not allow cloning. > > Conceptually, this is similar to a KBox, except that it delegates > resource management to the T instead of using a generic allocator. > > Signed-off-by: Asahi Lina You can't send a patch by others without adding your own SoB. Alice