(self, default: impl FnOnce() -> S)
| 1119 | /// |
| 1120 | /// Returns `None` if the given resource does not exist. |
| 1121 | pub fn try_get<S: Send + 'static>(&self) -> Option<&S> { |
| 1122 | self.0 |
| 1123 | .get(&TypeId::of::<S>()) |
| 1124 | .map(|s| s.downcast_ref().unwrap()) |
| 1125 | } |
| 1126 | |
| 1127 | /// Get a mutable reference to a resource in the store. |
| 1128 | /// |
| 1129 | /// Returns `None` if the given resource does not exist. |
no test coverage detected