12 releases (7 breaking)
0.10.2 | Jul 12, 2022 |
---|---|
0.9.0 |
|
#2066 in Rust patterns
Used in mmtkvdb
15KB
232 lines
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)]
toOwned
wrapper
- 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 theGenericCow
trait, which aids type inference. - Implementation of
From
forOwned
had 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>
toT
whereT: !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
Owned
is now a simple wrapper with one type argument (of its inner value). Owned::new
has been removed.- The associated type
GenericCow<B>::Owned
has 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
Deref
as supertrait ofGenericCow
and added type argument toGenericCow
instead
- Removed
- 2022-07-01: Version 0.6.1
- Corrected
Owned::borrowed
to 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 aPhantomData
of a reference to the borrowed type. This makesOwnedRef
superfluous, which has been removed. IntoOwned
has been renamed toGenericCow
.- Removed
AsMut
,BorrowMut
andDerefMut
implementations forOwned
- A lifetime and type argument for the borrowed type has been added to
- 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