Registry / utility / memoize

memoize

JSON →
library0.6.0rscratesunverified

Attribute macro for automatically memoizing functions with simple signatures.

# Cargo.toml [dependencies] memoize = "0.6.0"
INSTALL
IMPORT
SIG · MEMOIZE
M
memoize
utilityrustv0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

memoize
use memoize::memoize;

Apply the memoize attribute macro to cache function results.

use memoize::memoize; #[memoize] fn expensive_computation(n: u32) -> u32 { // Expensive computation here n * 2 } fn main() { let result = expensive_computation(5); }
Debug
Known issues
gotchaMemoization may not work correctly with non-Clone or non-Eq types.
fix
Ensure function arguments implement Clone and Eq/Hash.
affects: >=0.6.0
Upgrade
Version history
0.6.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
memoize — cargo add memoize · libregistry