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

Method register_scheme

std/src/storage/mod.rs:399–403  ·  view source on GitHub ↗

Registers a new drive `factory` to handle the `scheme`. Must not have previously been registered and the `scheme` must be in lowercase.

(&mut self, scheme: &str, factory: Box<dyn DriveFactory>)

Source from the content-addressed store, hash-verified

397 /// Registers a new drive `factory` to handle the `scheme`. Must not have previously been
398 /// registered and the `scheme` must be in lowercase.
399 pub fn register_scheme(&mut self, scheme: &str, factory: Box<dyn DriveFactory>) {
400 assert_eq!(scheme.to_lowercase(), scheme);
401 let previous = self.factories.insert(scheme.to_owned(), factory);
402 assert!(previous.is_none(), "Tried to register {} twice", scheme);
403 }
404
405 /// Returns true if the `scheme` is already registered.
406 pub fn has_scheme(&self, scheme: &str) -> bool {

Callers 10

add_allFunction · 0.80
defaultMethod · 0.80
setup_storageFunction · 0.80
test_storage_has_schemeFunction · 0.80
test_storage_mount_okFunction · 0.80
test_storage_mountedFunction · 0.80
setup_storageFunction · 0.80

Calls 1

insertMethod · 0.45

Tested by 7

defaultMethod · 0.64
test_storage_has_schemeFunction · 0.64
test_storage_mount_okFunction · 0.64
test_storage_mountedFunction · 0.64