deref_owned
Generalization of std::borrow::Cow, which can be used to reduce runtime
overhead in certain scenarios.
Changelog
- 2022-07-12: Version 0.10.2
- Improved documentation
- 2022-07-10: Version 0.10.1
- Improved documentation
- Added
#[repr(transparent)]toOwnedwrapper
- 2022-07-10: Version 0.10.0
- The borrowed (i.e. pointed-to) type is now used as a type argument for
Owned. This allows specifying the borrowed type as an associated type of theGenericCowtrait, which aids type inference. - Implementation of
FromforOwnedhad to be removed.
- The borrowed (i.e. pointed-to) type is now used as a type argument for
- 2022-07-04: Version 0.8.2
- Added implementation of
From<T>forOwned<T> - Added missing version numbers 0.8.0 and 0.8.1 in changelog
- Added some tests
- Added implementation of
- 2022-07-04: Version 0.9.0 (yanked)
- Added implementation of
From<T>forOwned<T> - Removed implementation of
AsRef<U>forOwned<T>and implementAsRef<T>only (this is to allow going fromOwned<T>toTwhereT: !AsRef<T>) (Yanked because.borrow()should be used in that case.) - Added missing version numbers 0.8.0 and 0.8.1 in changelog
- Added implementation of
- 2022-07-04: Version 0.8.1
- Added example to crate-level documentation comment
- 2022-07-02: Version 0.8.0
- Struct
Ownedis now a simple wrapper with one type argument (of its inner value). Owned::newhas been removed.- The associated type
GenericCow<B>::Ownedhas been removed in favor of using<B as ToOwned>::Owned. - Modified documentation to avoid the terminology "smart pointer"
- Modified tests
- Struct
- 2022-07-01: Version 0.7.0
- Removed
Derefas supertrait ofGenericCowand added type argument toGenericCowinstead
- Removed
- 2022-07-01: Version 0.6.1
- Corrected
Owned::borrowedto bePhantomData<for<'a> fn(&'a O) -> &'a B>instead of usingPhantomData<*const B>, which broke correct autotrait behavior
- Corrected
- 2022-07-01: Version 0.6.0
- Removed lifetime argument for
Owned - Fixed changelog for version 0.5.0
- Removed lifetime argument for
- 2022-07-01: Version 0.5.0
- A lifetime and type argument for the borrowed type has been added to
Owned, which now contains aPhantomDataof a reference to the borrowed type. This makesOwnedRefsuperfluous, which has been removed. IntoOwnedhas been renamed toGenericCow.- Removed
AsMut,BorrowMutandDerefMutimplementations forOwned
- A lifetime and type argument for the borrowed type has been added to
- 2022-06-30: Version 0.4.0
- Removed implementations of
IntoOwnedforBox<T>,Vec<T>, andString - New wrapper type
OwnedRef<T>
- Removed implementations of
- 2022-06-28: Version 0.3.0
- Added implementations of
IntoOwnedforBox<T>(where T: ?Sized),Vec<T>, andString, withIntoOwned::Ownedbeing 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) Derefis now a supertrait ofIntoOwnedandIntoOwned::Ownedmust implementBorrow<<Self as Deref>::Target>
- Some more trait implementations (
- 2022-06-26: Version 0.1.0
- Initial release