changeset 34:65332ad1cf1b

Update README
author Илья Ефимов <inferrna@gmail.com>
date Fri, 11 Dec 2020 01:28:20 +0800
parents e06b174fc82f
children db9afeb14f1d
files README.md
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/README.md	Fri Dec 11 01:27:49 2020 +0800
+++ b/README.md	Fri Dec 11 01:28:20 2020 +0800
@@ -77,6 +77,16 @@
 of parsing attribute parameters. Currently, compiling will fail if you use a
 parameter such as `Capacity` without the feature `full` being enabled.
 
+
+Another parameter is TimeToLive. Example:
+```rust
+#[memoize(Capacity: 123, TimeToLive: Duration::from_secs(2))]
+```
+chrono::Duration is also possible, but have to be converted into std::time::Duration
+```rust
+#[memoize(TimeToLive: chrono::Duration::hours(3).to_std().unwrap())]
+```
+
 ## Contributions
 
 ...are always welcome! This being my first procedural-macros crate, I am