MCPcopy Create free account
hub / github.com/Rustixir/darkbird / with_vecstore

Method with_vecstore

src/darkbird/schema.rs:61–79  ·  view source on GitHub ↗
(mut self, opts: Options<'a>)

Source from the content-addressed store, hash-verified

59
60
61 pub async fn with_vecstore<'a>(mut self, opts: Options<'a>) -> Result<Schema, SchemaError> {
62
63 if self.names.contains(opts.storage_name) {
64 return Err(SchemaError::DatastoreAlreadyExist(opts.storage_name.to_owned()))
65 }
66
67 if let Some(_) = self.datastores.get::<VecStorage>() {
68 return Err(SchemaError::DatastoreAlreadyExist(opts.storage_name.to_owned()))
69 }
70
71 match VecStorage::open(opts).await {
72 Err(e) => Err(SchemaError::Err(e)),
73 Ok(ds) => {
74 self.datastores.insert(ds);
75 Ok(self)
76 }
77 }
78
79 }
80
81
82

Callers 2

mainFunction · 0.80
k_nearest_neighborsFunction · 0.80

Calls 1

insertMethod · 0.45

Tested by 1

k_nearest_neighborsFunction · 0.64