MCPcopy Create free account
hub / github.com/EbTech/rust-algorithms / call_and_replace

Method call_and_replace

src/caching.rs:68–72  ·  view source on GitHub ↗

Calls the function without performing a lookup and replaces the old return value with the new one, and returns it. Potentially useful if the function reads from a file or RNG whose state may have changed. TODO: if there's state, FnMut seems more appropriate.

(&mut self, arg: U)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

test_call_and_replaceFunction · 0.80

Calls 1

insertMethod · 0.80

Tested by 1

test_call_and_replaceFunction · 0.64