diff --git a/release-content/0.15/migration-guides/14082_AssetReader_read_now_returns_an_opaque_type.md b/release-content/0.15/migration-guides/14082_AssetReader_read_now_returns_an_opaque_type.md new file mode 100644 index 0000000000..7c07d63a14 --- /dev/null +++ b/release-content/0.15/migration-guides/14082_AssetReader_read_now_returns_an_opaque_type.md @@ -0,0 +1,38 @@ +The trait method `bevy_asset::io::AssetReader::read` (and `read_meta`) now return an opaque type instead of a boxed trait object. Implementors of these methods should change the type signatures appropriately: + +```rust +impl AssetReader for MyReader { + // Before + async fn read<'a>(&'a self, path: &'a Path) -> Result>, AssetReaderError> { + let reader = // construct a reader + Box::new(reader) as Box> + } + + // After + async fn read<'a>(&'a self, path: &'a Path) -> Result { + // create a reader + } +} +``` + +`bevy::asset::io::Reader` is now a trait, rather than a type alias for a trait object. Implementors of `AssetLoader::load` will need to adjust the method signature accordingly: + +```rust +impl AssetLoader for MyLoader { + async fn load<'a>( + &'a self, + // Before: + reader: &'a mut bevy::asset::io::Reader, + // After: + reader: &'a mut dyn bevy::asset::io::Reader, + _: &'a Self::Settings, + load_context: &'a mut LoadContext<'_>, + ) -> Result { +} +``` + +Additionally, implementors of `AssetReader` that return a type implementing `futures_io::AsyncRead` and `AsyncSeek` might need to explicitly implement `bevy::asset::io::Reader` for that type. + +```rust +impl bevy::asset::io::Reader for MyAsyncReadAndSeek {} +``` \ No newline at end of file diff --git a/release-content/0.15/migration-guides/15090_Deprecate_LoadAndSave_Asset_Processor.md b/release-content/0.15/migration-guides/15090_Deprecate_LoadAndSave_Asset_Processor.md new file mode 100644 index 0000000000..4b9e2538d9 --- /dev/null +++ b/release-content/0.15/migration-guides/15090_Deprecate_LoadAndSave_Asset_Processor.md @@ -0,0 +1,2 @@ +- Replace `LoadAndSave` with `LoadTransformAndSave::Asset>, S>` +- Replace `LoadAndSaveSettings` with `LoadTransformAndSaveSettings` diff --git a/release-content/0.15/migration-guides/_guides.toml b/release-content/0.15/migration-guides/_guides.toml index 26b33515ea..901ba2496a 100644 --- a/release-content/0.15/migration-guides/_guides.toml +++ b/release-content/0.15/migration-guides/_guides.toml @@ -1315,5 +1315,17 @@ file_name = "13760_Add_Display_implementation_to_DebugName.md" [[guides]] title = "Remove `accesskit` re-export from `bevy_a11y`" prs = [16257] -areas = [] +areas = ["Accessibility"] file_name = "16257_Remove_accesskit_reexport_from_bevy_a11y.md" + +[[guides]] +title = "Deprecate `LoadAndSave` Asset Processor" +prs = [15090] +areas = ["Asset"] +file_name = "15090_Deprecate_LoadAndSave_Asset_Processor.md" + +[[guides]] +title = "`AssetReader::read` now returns an opaque type" +prs = [14082] +areas = ["Asset"] +file_name = "14082_AssetReader_read_now_returns_an_opaque_type.md"