MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / write_metadata

Method write_metadata

crates/fs-utils/src/lockfile.rs:164–170  ·  view source on GitHub ↗

Replace the lock file contents with `metadata` while holding the lock.

(&mut self, metadata: impl AsRef<[u8]>)

Source from the content-addressed store, hash-verified

162
163 /// Replace the lock file contents with `metadata` while holding the lock.
164 pub fn write_metadata(&mut self, metadata: impl AsRef<[u8]>) -> io::Result<()> {
165 self.lock.set_len(0)?;
166 self.lock.seek(SeekFrom::Start(0))?;
167 self.lock.write_all(metadata.as_ref())?;
168 self.lock.sync_data()?;
169 Ok(())
170 }
171
172 /// Release the lock and optionally remove the locked file.
173 ///

Calls 5

set_lenMethod · 0.80
sync_dataMethod · 0.80
OkFunction · 0.50
seekMethod · 0.45
as_refMethod · 0.45