@@ -47,17 +47,17 @@ impl<T: Asset> Debug for AssetEvent<T> {
47
47
48
48
/// Stores Assets of a given type and tracks changes to them.
49
49
///
50
- /// Each asset is mapped by a unique [HandleId](crate::HandleId) , allowing any [Handle](crate::Handle)
51
- /// with the same HandleId to access it. These assets remain loaded for as long as a Strong handle
52
- /// to that asset exists.
50
+ /// Each asset is mapped by a unique [` HandleId`] , allowing any [` Handle`] with the same
51
+ /// [` HandleId`] to access it. These assets remain loaded for as long as a Strong handle to that
52
+ /// asset exists.
53
53
///
54
54
/// To store a reference to an asset without forcing it to stay loaded, you can use a Weak handle.
55
- /// To make a Weak handle a Strong one, use [Assets::get_handle](crate::Assets::get_handle) or pass
56
- /// the Assets collection into the handle's [make_strong](crate::Handle::make_strong) method.
57
- ///
58
- /// Remember, if there are no Strong handles for an asset (i.e. they have all been dropped), the asset
59
- /// will unload. Make sure you always have a Strong handle when you want to keep an asset loaded!
55
+ /// To make a Weak handle a Strong one, use [`Assets::get_handle`] or pass the `Assets` collection
56
+ /// into the handle's [`make_strong`](Handle::make_strong) method.
60
57
///
58
+ /// Remember, if there are no Strong handles for an asset (i.e. they have all been dropped), the
59
+ /// asset will unload. Make sure you always have a Strong handle when you want to keep an asset
60
+ /// loaded!
61
61
#[ derive( Debug ) ]
62
62
pub struct Assets < T : Asset > {
63
63
assets : HashMap < HandleId , T > ,
@@ -92,7 +92,7 @@ impl<T: Asset> Assets<T> {
92
92
/// Unless there exists another Strong handle for this asset, it's advised to use the returned
93
93
/// Strong handle. Not doing so may result in the unexpected release of the asset.
94
94
///
95
- /// See [set_untracked](Assets::set_untracked) for more info.
95
+ /// See [` set_untracked` ](Assets::set_untracked) for more info.
96
96
#[ must_use = "not using the returned strong handle may result in the unexpected release of the asset" ]
97
97
pub fn set < H : Into < HandleId > > ( & mut self , handle : H , asset : T ) -> Handle < T > {
98
98
let id: HandleId = handle. into ( ) ;
@@ -102,8 +102,8 @@ impl<T: Asset> Assets<T> {
102
102
103
103
/// Add/modify the asset pointed to by the given handle.
104
104
///
105
- /// If an asset already exists with the given HandleId, it will be modified. Otherwise the new asset
106
- /// will be inserted.
105
+ /// If an asset already exists with the given [` HandleId`] , it will be modified. Otherwise the
106
+ /// new asset will be inserted.
107
107
///
108
108
/// # Events
109
109
/// * [`AssetEvent::Created`]: Sent if the asset did not yet exist with the given handle
@@ -124,7 +124,7 @@ impl<T: Asset> Assets<T> {
124
124
/// Get the asset for the given handle.
125
125
///
126
126
/// This is the main method for accessing asset data from an [Assets] collection. If you need
127
- /// mutable access to the asset, use [get_mut](Assets::get_mut).
127
+ /// mutable access to the asset, use [` get_mut` ](Assets::get_mut).
128
128
pub fn get < H : Into < HandleId > > ( & self , handle : H ) -> Option < & T > {
129
129
self . assets . get ( & handle. into ( ) )
130
130
}
@@ -190,7 +190,7 @@ impl<T: Asset> Assets<T> {
190
190
self . assets . iter_mut ( ) . map ( |( k, v) | ( * k, v) )
191
191
}
192
192
193
- /// Get an iterator over all HandleIds in the collection.
193
+ /// Get an iterator over all [`HandleId`]'s in the collection.
194
194
pub fn ids ( & self ) -> impl Iterator < Item = HandleId > + ' _ {
195
195
self . assets . keys ( ) . cloned ( )
196
196
}
0 commit comments