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

Method remove

src/darkbird/storage_vector.rs:132–158  ·  view source on GitHub ↗
(&self, vid: VectorId)

Source from the content-addressed store, hash-verified

130 /// remove from storage and persist to disk
131 #[inline]
132 pub async fn remove(&self, vid: VectorId) -> Result<(), SessionResult> {
133 match self.vcache.get(&vid) {
134 Some(_) => {
135
136 if !self.off_disk || !self.off_reporter {
137 let query = RQuery::<VectorId, Vector>::Remove(vid.clone());
138
139 if !self.off_disk {
140 if let Err(e) = self.wal_session.log(bincode::serialize(&query).unwrap()).await {
141 return Err(e);
142 }
143 }
144
145 if !self.off_reporter {
146 let _ = self.reporter_session.dispatch(Event::Query(query)).await;
147 }
148
149 }
150
151 self.vcache.remove(&vid);
152
153 }
154 None => return Ok(()),
155 }
156
157 Ok(())
158 }
159
160 /// gets documents
161 #[inline]

Callers 1

loaderMethod · 0.45

Calls 3

logMethod · 0.80
dispatchMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected