MCPcopy Create free account
hub / github.com/cosdata/cosdata / clone_neighbors

Method clone_neighbors

src/models/prob_node.rs:331–345  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

329 }
330
331 pub fn clone_neighbors(&self) -> Neighbors {
332 let _guard = self.freeze();
333 self.neighbors
334 .iter()
335 .map(|neighbor| unsafe {
336 AtomicPtr::new(
337 neighbor
338 .load(Ordering::SeqCst)
339 .as_ref()
340 .map_or_else(ptr::null_mut, |neighbor| Box::into_raw(Box::new(*neighbor))),
341 )
342 })
343 .collect::<Vec<_>>()
344 .into_boxed_slice()
345 }
346
347 pub fn get_neighbors_raw(&self) -> &Neighbors {
348 &self.neighbors

Callers

nothing calls this directly

Calls 3

freezeMethod · 0.80
loadMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected