deref_owned
This crate provides a smart pointer Owned
, which points to an owned value.
It's similar to Cow
, except that it's always owning its pointee. Moreover, a
trait IntoOwned
is provided, which allows conversion of certain pointers into
an owned value though an .into_owned()
method. The trait IntoOwned
is
implemented for:
&'a T where T: ?Sized + ToOwned
Cow<'a, T> where T: ?Sized + ToOwned
Owned<T>
OwnedRef<T>
(also provided byderef_owned
)
Changelog
- 2022-06-30: Version 0.4.0
- Removed implementations of
IntoOwned
forBox<T>
,Vec<T>
, andString
- New wrapper type
OwnedRef<T>
- Removed implementations of
- 2022-06-28: Version 0.3.0
- Added implementations of
IntoOwned
forBox<T>
(where T: ?Sized
),Vec<T>
, andString
, withIntoOwned::Owned
being set toSelf
(replaces previous implementation forBox<T>
)
- Added implementations of
- 2022-06-27: Version 0.2.0
- Some more trait implementations (
AsRef
,AsMut
,Borrow
,BorrowMut
, andDisplay
) have been added forOwned
(andDebug::fmt
's output is transparent now) Deref
is now a supertrait ofIntoOwned
andIntoOwned::Owned
must implementBorrow<<Self as Deref>::Target>
- Some more trait implementations (
- 2022-06-26: Version 0.1.0
- Initial release