Releases: a1phyr/assets_manager
Version 0.12.4
Version 0.12.1
- Implement
DirLoadable
forOnceInitCell
when possible
Version 0.12.0
- Remove
NotHotReloaded
trait andHandle::get
(Handle::read
is still guaranteed to be a no-op whenHOT_RELOADED
isfalse
) Storable
trait is now a trait alias ofSized + Send + Sync + 'static
. All customStorable
implementations can be removed without breaking anything.- Remove
rodio
support from the main crate. It is now done inassets_manager-rodio
. - Add
zip-zstd
for easy zstd support in Zip - Use
hashbrown
to avoid hashing keys multiple times, which increases performance - Zip, Tar: remove deprecated
from_slice
- Update
image
to0.25
- Update MSRV to 1.71
Version 0.11.6
- No longer depend on
serde
's derive feature - Improve performance of opening
Zip
For version starting from 0.18
, rodio
support is in assets_manager-rodio
. This allows keeping up to date with rodio
versions more easily, and potentially improving compile times.
Version 0.11.5
- Internals improvements
Version 0.11.4
- Update
base64
to 0.22 - Improve internals to reduce monomorphization per asset type
Version 0.11.3
- Add
downcast
method toAssetReadGuard<'_, dyn Any>
- Add
into_inner
anddowncast
methods toError
- Implement
Default
for many types (includingAssetCache
,LocalAssetCache
,source::Empty
,ReloadId
andAtomicReloadId
) - Doc: Make it clear that
get_or_insert
inhibits hot-reloading
Version 0.11.2
Added
- Support for deriving
Asset
trait#[derive(Asset, serde::Deserialize)] #[asset_format = "ron"] struct Point { x: i32, y: i32, }
AssetReadGuard::map
andAssetReadGuard::try_map
- Many methods on
UntypedHandle
to mirror those onHandle<T>
Changed
Zip::from_bytes*
andTar::from_bytes*
are now generic over the bytes type.
In consequence,from_slice*
are now deprecated.- Small documentation improvements.
Version 0.11.1
- Use
sync_file::SyncFile
as default type parameter ofTar
Version 0.11.0
Highlights
-
Hot-reloading was reworked to be easier to implement and more robust to use while simplifying internals.
- Hot-reloading implementation now only have to send the changed files instead of tracking asset types and ids. Hot-reloading APIs were changed to reflect this.
Compound
implementations can now use rawSource
methods from the cache and everything will work.
This means that usingload_owned
instead ofT::load
is no longer necessary, and that it is possible to read files directly.- Hot-reloading now works for directories.
-
Changed
Handle<'a, T>
to&'a Handle<T>
. This conveys better the fact that it is a reference and makes its use easier. Getting an ownedHandle<T>
is not possible.impl<'a> AnyCache<'a> { - fn load<T: Compound>(self, id: &str) -> Handle<'a, T> { ... } + fn load<T: Compound>(self, id: &str) -> &'a Handle<T> { ... } }
Handle::same_handle
was removed in favor ofstd::ptr::eq
.PartialEq
andEq
implementations were removed in favor of explicit locking.- A field
id
was added to theDebug
implementation.
-
Directories are now regular
Compound
s that can be used with all APIs. Two methodsload_dir
andload_rec_dir
are still provided for convenience.-let handle = cache.load_dir::<T>(id, false)?; +let handle = cache.load_dir::<T>(id)?; -let handle = cache.load_dir::<T>(id, true)?; +let handle = cache.load_rec_dir::<T>(id)?;
-
Support for TAR archives was added.
let cache = AssetCache::with_source(source::Tar::open("assets.tar")?);
-
LocalAssetCache
, a thread-local variant ofAssetCache
was added.
It cannot be shared across threads but is more performant due to the lack of synchronization. Appart from that, it works exactly the same. -
UntypedHandle
, a type-erased variant ofHandle<T>
was added
It can be obtained from aHandle<T>
. LikeHandle
it can be used to get its id or even read to get a&dyn Any
. -
AsAnyCache
trait was added to easily make generic interfaces over cache types.
Other changes
Asset::default_value
now usesBoxedError
instead ofassets_manager::Error
and&SharedString
instead of&str
. It remains functionally the same appart from that.parking_lot
feature is no longer enabled by default.basic-toml
is now used instead oftoml_edit
.- Errors when reading from ZIP or from the file system were improved.
- Rename
AssetGuard
toAssetReadGuard
- Removed
Asset
implementation forBox
- Removed
Debug
impl of loaders. They could not be used anyway. AnyCache
now always take methods by value- MSRV is now 1.70
Other additions
OnceInitCell
now implementUnwindSafe
andRefUnwindSafe
ReloadId::NEVER
Bug fixes
- A condition was inverted for when to emit a warning log in hot-reloading