Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenable the sync feature for doc.rs #318

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,18 @@ rustc_version = "0.4.0"

# https://docs.rs/about/metadata
[package.metadata.docs.rs]
# Build the doc with some features enabled.
features = ["future"]
# Build the doc at docs.rs with some features enabled.
#
# You can test locally with:
# ```
# cargo +nightly -Z unstable-options --config 'build.rustdocflags="--cfg docsrs"' \
# doc --no-deps --features 'future, sync'
# ```
features = ["future", "sync"]
rustdoc-args = ["--cfg", "docsrs"]

# Examples

[[example]]
name = "async_example"
required-features = ["future"]
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,14 @@ details.

## Usage

Add this to your `Cargo.toml`:
To add Moka to your dependencies, run `cargo add` as the followings:

```toml
[dependencies]
moka = "0.12"
```

To use the asynchronous cache, enable a crate feature called "future".
```console
# To use the synchronous cache:
cargo add moka --features sync

```toml
[dependencies]
moka = { version = "0.12", features = ["future"] }
# To use the asynchronous cache:
cargo add moka --features future
```


Expand Down Expand Up @@ -508,14 +504,14 @@ $ RUSTFLAGS='--cfg skeptic --cfg trybuild' cargo test --all-features

```console
$ RUSTFLAGS='--cfg skeptic --cfg trybuild' cargo test \
--no-default-features --features future
--no-default-features --features 'future, sync'
```

**Generating the Doc**

```console
$ cargo +nightly -Z unstable-options --config 'build.rustdocflags="--cfg docsrs"' \
doc --no-deps --features future
doc --no-deps --features 'future, sync'
```

## Road Map
Expand All @@ -529,11 +525,13 @@ $ cargo +nightly -Z unstable-options --config 'build.rustdocflags="--cfg docsrs"
- `blocking_insert(K, V)` → `blocking().insert(K, V)`
- `time_to_live()` → `policy().time_to_live()`
- [x] Notifications on eviction. (`v0.9.0` via [#145][gh-pull-145])
- [x] Variable (per-entry) expiration, using a hierarchical timer wheel.
- [x] Variable (per-entry) expiration, using hierarchical timer wheels.
(`v0.11.0` via [#248][gh-pull-248])
- [ ] Cache statistics. (Hit rate, etc.)
- [ ] Cache statistics (Hit rate, etc.). ([details][cache-stats])
- [x] Remove background threads. (`v0.12.0` via [#294][gh-pull-294] and
[#316][gh-pull-316])
- [ ] Restore cache from a snapshot. ([details][restore])
- [ ] `and_compute` method. ([details][and-compute])
- [ ] Upgrade TinyLFU to Window-TinyLFU. ([details][tiny-lfu])

[gh-pull-024]: https://github.com/moka-rs/moka/pull/24
Expand All @@ -543,6 +541,9 @@ $ cargo +nightly -Z unstable-options --config 'build.rustdocflags="--cfg docsrs"
[gh-pull-294]: https://github.com/moka-rs/moka/pull/294
[gh-pull-316]: https://github.com/moka-rs/moka/pull/316

[and-compute]: https://github.com/moka-rs/moka/issues/227
[cache-stats]: https://github.com/moka-rs/moka/issues/234
[restore]: https://github.com/moka-rs/moka/issues/314

## About the Name

Expand Down
Loading