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

Method allocate_inode

atomic-core/src/output/memory.rs:293–295  ·  view source on GitHub ↗

Allocate a new unique inode. Each call returns a different inode value. # Example ```rust use atomic_core::output::Memory; let wc = Memory::new(); let inode1 = wc.allocate_inode(); let inode2 = wc.allocate_inode(); assert_ne!(inode1, inode2); ```

(&self)

Source from the content-addressed store, hash-verified

291 /// assert_ne!(inode1, inode2);
292 /// ```
293 pub fn allocate_inode(&self) -> Inode {
294 Inode::new(self.next_inode.fetch_add(1, Ordering::SeqCst))
295 }
296
297 /// Add a file with the given contents.
298 ///

Callers 6

add_fileMethod · 0.80
test_write_fileFunction · 0.80

Calls

no outgoing calls