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

Method get

src/models/atomic_array.rs:76–85  ·  view source on GitHub ↗
(&self, idx: usize)

Source from the content-addressed store, hash-verified

74 }
75
76 pub fn get(&self, idx: usize) -> Option<*mut T> {
77 if idx >= N {
78 return None;
79 }
80 let ptr = self.items[idx].load(Ordering::SeqCst);
81 if ptr.is_null() {
82 return None;
83 }
84 Some(ptr)
85 }
86
87 pub fn is_empty(&self) -> bool {
88 self.items[0].load(Ordering::SeqCst).is_null()

Callers

nothing calls this directly

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected