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

Function add_all

client/src/cmds.rs:592–612  ·  view source on GitHub ↗

Adds all remote manipulation commands for `service` to the `machine`, using `console` to display information and `storage` to manipulate the remote drives.

(
    machine: &mut MachineBuilder,
    service: Rc<RefCell<dyn Service>>,
    console: Rc<RefCell<dyn Console>>,
    storage: Rc<RefCell<Storage>>,
    exec_base_url: S,
)

Source from the content-addressed store, hash-verified

590/// Adds all remote manipulation commands for `service` to the `machine`, using `console` to
591/// display information and `storage` to manipulate the remote drives.
592pub fn add_all<S: Into<String>>(
593 machine: &mut MachineBuilder,
594 service: Rc<RefCell<dyn Service>>,
595 console: Rc<RefCell<dyn Console>>,
596 storage: Rc<RefCell<Storage>>,
597 exec_base_url: S,
598) {
599 storage
600 .borrow_mut()
601 .register_scheme("cloud", Box::from(CloudDriveFactory::new(service.clone())));
602
603 machine.add_callable(LoginCommand::new(service.clone(), console.clone(), storage.clone()));
604 machine.add_callable(LogoutCommand::new(service.clone(), console.clone(), storage.clone()));
605 machine.add_callable(ShareCommand::new(
606 service.clone(),
607 console.clone(),
608 storage,
609 exec_base_url,
610 ));
611 machine.add_callable(SignupCommand::new(service, console));
612}
613
614#[cfg(test)]
615mod tests {

Callers 2

run_repl_loopFunction · 0.50
run_interactiveFunction · 0.50

Calls 2

register_schemeMethod · 0.80
add_callableMethod · 0.45

Tested by

no test coverage detected