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

Method new_with_lock

src/models/chunked_list.rs:49–57  ·  view source on GitHub ↗
(item: Item<T>)

Source from the content-addressed store, hash-verified

47 }
48
49 pub fn new_with_lock(item: Item<T>) -> Self {
50 LazyItemRef {
51 item: Arc::new(RwLock::new(LazyItem {
52 data: Some(item),
53 offset: None,
54 decay_counter: 0,
55 })),
56 }
57 }
58
59 pub fn get_data(&self) -> Option<Item<T>> {
60 self.item.read().unwrap().data.clone()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected