MCPcopy Create free account
hub / github.com/argumentcomputer/ix / write

Method write

crates/compile/src/store.rs:86–91  ·  view source on GitHub ↗

Write bytes to the store and return their address (blake3 hash)

(bytes: &[u8])

Source from the content-addressed store, hash-verified

84
85 /// Write bytes to the store and return their address (blake3 hash)
86 pub fn write(bytes: &[u8]) -> StoreResult<Address> {
87 let addr = Address::hash(bytes);
88 let path = Self::store_path(&addr)?;
89 fs::write(path, bytes)?;
90 Ok(addr)
91 }
92
93 /// Read bytes from the store given an address
94 pub fn read(addr: &Address) -> StoreResult<Vec<u8>> {

Callers 1

agg_stdinFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected