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

Method mount

std/src/storage/mod.rs:461–473  ·  view source on GitHub ↗

Instantiates and attaches a new `drive` with `name` that points to `uri`. The `name` must be valid and must not yet have been registered.

(&mut self, name: &str, uri: &str)

Source from the content-addressed store, hash-verified

459 ///
460 /// The `name` must be valid and must not yet have been registered.
461 pub fn mount(&mut self, name: &str, uri: &str) -> io::Result<()> {
462 let (scheme, path) = split_uri(uri)?;
463 let drive = match self.factories.get(&scheme.to_lowercase()) {
464 Some(factory) => factory.create(path)?,
465 None => {
466 return Err(io::Error::new(
467 io::ErrorKind::InvalidInput,
468 format!("Unknown mount scheme '{}'", scheme),
469 ));
470 }
471 };
472 self.attach(name, uri, drive)
473 }
474
475 /// Detaches an existing drive named `name`.
476 ///

Callers 15

do_loginMethod · 0.80
setup_storageFunction · 0.80
execMethod · 0.80
test_cd_okFunction · 0.80
test_unmount_okFunction · 0.80
test_storage_mount_okFunction · 0.80

Calls 4

split_uriFunction · 0.85
attachMethod · 0.80
getMethod · 0.45
createMethod · 0.45