fncache-macros
Procedural macros for the fncache library, providing attribute macros for zero-boilerplate function caching.
Overview
This crate implements the procedural macros that power the fncache caching library. It's typically not used directly but through the main fncache crate.
Features
- #[fncache] - The main attribute macro for caching function results
- Supports both synchronous and asynchronous functions
- Runtime and compile-time key derivation strategies
- TTL (Time-To-Live) configuration
Usage
This crate is meant to be used through the main fncache crate:
# Cargo.toml
[]
= "0.1.0"
The macros are re-exported by the main crate:
use fncache;
async
Options
- ttl (optional, default: 60) - Cache time-to-live in seconds
- key_derivation (optional, default: "runtime")
- "runtime" - Keys are derived from function arguments
- "compile_time" - Keys are derived from the function name and module path
License
MIT License - see LICENSE for details.