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 pointers to an owned
value though an .into_owned()
method. The trait IntoOwned
is currently
implemented for:
&'a T where T: ?Sized + ToOwned
Cow<'a, T> where T: ?Sized + ToOwned
Owned<T>
Box<T> where T: ?Sized
Vec<T>
String
Changelog
- 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