Skip to content

Commit 791a0e4

Browse files
authored
Amend AssetSaver documentation (#22604)
# Objective `AssetSaver` documentation currently insists that it is a mirror of `AssetLoader` and encourages users to use it if they want to save assets. This is unfortunate, as `AssetSaver` currently isn't really set up to do that without an awful lot of deeply weird hoop jumping, and thus serves as a bit of a trap. ## Solution Remove doc comments promoting `AssetSaver` for this purpose and add a disclaimer noting that it does not do this - yet. ## Testing ## Showcase
1 parent 2472949 commit 791a0e4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

crates/bevy_asset/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@
135135
//! After the loader is implemented, it needs to be registered with the [`AssetServer`] using [`App::register_asset_loader`](AssetApp::register_asset_loader).
136136
//! Once your asset type is loaded, you can use it in your game like any other asset type!
137137
//!
138-
//! If you want to save your assets back to disk, you should implement [`AssetSaver`](saver::AssetSaver) as well.
139-
//! This trait mirrors [`AssetLoader`] in structure, and works in tandem with [`AssetWriter`](io::AssetWriter), which mirrors [`AssetReader`](io::AssetReader).
140138
141139
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
142140
#![cfg_attr(docsrs, feature(doc_cfg))]

crates/bevy_asset/src/saver.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ use serde::{Deserialize, Serialize};
1515
///
1616
/// This trait is generally used in concert with [`AssetWriter`](crate::io::AssetWriter) to write assets as bytes.
1717
///
18-
/// For a complementary version of this trait that can load assets, see [`AssetLoader`].
18+
/// For a version of this trait that can load assets, see [`AssetLoader`].
19+
///
20+
/// Note: This is currently only leveraged by the [`AssetProcessor`](crate::processor::AssetProcessor), and does not provide a
21+
/// suitable interface for general purpose asset persistence. See [github issue #11216](https://github.com/bevyengine/bevy/issues/11216).
22+
///
1923
pub trait AssetSaver: TypePath + Send + Sync + 'static {
2024
/// The top level [`Asset`] saved by this [`AssetSaver`].
2125
type Asset: Asset;

0 commit comments

Comments
 (0)