MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / allocate_view_id

Method allocate_view_id

atomic-core/src/pristine/txn/write/mod.rs:144–152  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

142 }
143
144 fn allocate_view_id(&mut self) -> PristineResult<u64> {
145 if let Some((_, _, next)) = &mut self.preview_allocations {
146 let id = *next;
147 *next = next.checked_add(1).ok_or(PristineError::IdSpaceExhausted)?;
148 Ok(id)
149 } else {
150 Ok(self.next_view_id.fetch_add(1, Ordering::SeqCst))
151 }
152 }
153
154 /// Populate the session tables from a provenance graph.
155 ///

Callers 2

open_or_create_viewMethod · 0.80
create_viewMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected