MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / store_access_record

Function store_access_record

crates/hyperqueue/src/common/serverdir.rs:272–283  ·  view source on GitHub ↗
(
    record: &R,
    path: P,
)

Source from the content-addressed store, hash-verified

270}
271
272pub fn store_access_record<R: ?Sized + Serialize, P: AsRef<Path>>(
273 record: &R,
274 path: P,
275) -> crate::Result<()> {
276 log::info!("Storing access file as '{}'", path.as_ref().display());
277 let mut options = OpenOptions::new();
278 options.write(true).create_new(true).mode(0o400); // Read for user, nothing for others
279
280 let file = options.open(path.as_ref())?;
281 serde_json::to_writer_pretty(file, record)?;
282 Ok(())
283}
284
285pub fn load_worker_access_file<P: AsRef<Path>>(path: P) -> crate::Result<WorkerAccessRecord> {
286 let raw = load_and_check_version(path.as_ref())?;

Callers 5

createMethod · 0.85
test_store_loadFunction · 0.85

Calls 2

as_refMethod · 0.80
openMethod · 0.45

Tested by 3

test_store_loadFunction · 0.68