Skip to content

Releases: a1phyr/assets_manager

Version 0.11.6

29 May 11:49
Compare
Choose a tag to compare
  • 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

17 Apr 08:54
Compare
Choose a tag to compare
  • Internals improvements

Version 0.11.4

21 Mar 08:53
Compare
Choose a tag to compare
  • Update base64 to 0.22
  • Improve internals to reduce monomorphization per asset type

Version 0.11.3

29 Feb 17:03
Compare
Choose a tag to compare
  • Add downcast method to AssetReadGuard<'_, dyn Any>
  • Add into_inner and downcast methods to Error
  • Implement Default for many types (including AssetCache, LocalAssetCache, source::Empty, ReloadId and AtomicReloadId)
  • Doc: Make it clear that get_or_insert inhibits hot-reloading

Version 0.11.2

14 Jan 21:56
Compare
Choose a tag to compare

Added

  • Support for deriving Asset trait
    #[derive(Asset, serde::Deserialize)]
    #[asset_format = "ron"]
    struct Point {
        x: i32,
        y: i32,
    }
  • AssetReadGuard::map and AssetReadGuard::try_map
  • Many methods on UntypedHandle to mirror those on Handle<T>

Changed

  • Zip::from_bytes* and Tar::from_bytes* are now generic over the bytes type.
    In consequence, from_slice* are now deprecated.
  • Small documentation improvements.

Version 0.11.1

06 Jan 00:00
Compare
Choose a tag to compare
  • Use sync_file::SyncFile as default type parameter of Tar

Version 0.11.0

30 Dec 16:00
Compare
Choose a tag to compare

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 raw Source methods from the cache and everything will work.
      This means that using load_owned instead of T::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 owned Handle<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 of std::ptr::eq.
    • PartialEq and Eq implementations were removed in favor of explicit locking.
    • A field id was added to the Debug implementation.
  • Directories are now regular Compounds that can be used with all APIs. Two methods load_dir and load_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 of AssetCache 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 of Handle<T> was added
    It can be obtained from a Handle<T>. Like Handle 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 uses BoxedError instead of assets_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 of toml_edit.
  • Errors when reading from ZIP or from the file system were improved.
  • Rename AssetGuard to AssetReadGuard
  • Removed Asset implementation for Box
  • 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 implement UnwindSafe and RefUnwindSafe
  • ReloadId::NEVER

Bug fixes

  • A condition was inverted for when to emit a warning log in hot-reloading

Version 0.10.2

06 Jun 16:03
Compare
Choose a tag to compare
  • Reduce monomorphization when hot-reloading is enabled

Version 0.10.1

17 May 13:59
Compare
Choose a tag to compare
  • Move documentation from AssetCache to AnyCache
  • Update notify to 6.0

Version 0.10.0

06 Apr 15:25
Compare
Choose a tag to compare
  • Make DirHandle Send + Sync

Breaking:

  • Update rodio to 0.17
  • Make Source::read return a FileContent. This is basically a Cow<[u8]> with a new Box<dyn AsRef<[u8]>> variant.
  • Rename AnyCache::source to raw_source