MCPcopy Create free account
hub / github.com/BillyDM/Firewheel / or_insert_with_any

Method or_insert_with_any

crates/firewheel-core/src/node.rs:1128–1133  ·  view source on GitHub ↗
(self, default: impl FnOnce() -> Box<dyn Any + Send>)

Source from the content-addressed store, hash-verified

1126
1127 /// Get a mutable reference to a resource in the store.
1128 ///
1129 /// Returns `None` if the given resource does not exist.
1130 pub fn try_get_mut<S: Send + 'static>(&mut self) -> Option<&mut S> {
1131 self.0
1132 .get_mut(&TypeId::of::<S>())
1133 .map(|s| s.downcast_mut().unwrap())
1134 }
1135}
1136

Callers

nothing calls this directly

Calls 2

downcast_mutMethod · 0.80
or_insert_withMethod · 0.80

Tested by

no test coverage detected