On 10/1/25 11:03 AM, Oliver Mangold wrote:
> From: Asahi Lina <[email protected]>
> 
> 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<T>`, except that it delegates
> resource management to the `T` instead of using a generic allocator.
> 
> [ om:
>   - Split code into separate file and `pub use` it from types.rs.
>   - Make from_raw() and into_raw() public.
>   - Remove OwnableMut, and make DerefMut dependent on Unpin instead.
>   - Usage example/doctest for Ownable/Owned.
>   - Fixes to documentation and commit message.
> ]
> 
> Link: 
> https://lore.kernel.org/all/[email protected]/
> Signed-off-by: Asahi Lina <[email protected]>
> Co-developed-by: Oliver Mangold <[email protected]>
> Signed-off-by: Oliver Mangold <[email protected]>
> Reviewed-by: Boqun Feng <[email protected]>
I think this patch was originally sent by Abdiel and Boqun [1]; we should
probably take this into account. :)

[1]
https://lore.kernel.org/rust-for-linux/[email protected]/

Reply via email to