MCPcopy Index your code
hub / github.com/endbasic/endbasic / add_callable

Method add_callable

std/src/lib.rs:290–299  ·  view source on GitHub ↗

Registers the given builtin callable, which must not yet be registered.

(&mut self, callable: Rc<dyn Callable>)

Source from the content-addressed store, hash-verified

288
289 /// Registers the given builtin callable, which must not yet be registered.
290 pub fn add_callable(&mut self, callable: Rc<dyn Callable>) {
291 let metadata = callable.metadata();
292 let key = SymbolKey::from(metadata.name());
293
294 let previous = self.callables.insert(key.clone(), callable);
295 debug_assert!(previous.is_none(), "Cannot insert a callable twice");
296
297 let previous = self.callables_metadata.borrow_mut().insert(key, metadata);
298 debug_assert!(previous.is_none(), "Cannot insert callable metadata twice");
299 }
300
301 /// Returns metadata for all callables currently registered in the builder.
302 pub fn callables_metadata(&self) -> Rc<RefCell<HashMap<SymbolKey, Rc<CallableMetadata>>>> {

Callers 15

add_allFunction · 0.45
defaultMethod · 0.45
add_allFunction · 0.45
add_allFunction · 0.45
add_allFunction · 0.45
tester_withFunction · 0.45
add_scriptingFunction · 0.45
add_interactiveFunction · 0.45
add_allFunction · 0.45
add_allFunction · 0.45
add_allFunction · 0.45
add_allFunction · 0.45

Calls 3

metadataMethod · 0.45
nameMethod · 0.45
insertMethod · 0.45

Tested by 1

defaultMethod · 0.36