Skip to content

Commit 19ff902

Browse files
committed
tweak(docs): some love and attention
1 parent 17b10bf commit 19ff902

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ It is advisable to use another solution if you have the option!
3535
- Asynchronous APIs
3636
- Fast and reliable reading/writing
3737
- Tuned for large-file databases
38+
- Included cache eviction (LRU/FIFO)
3839
- Easily accessible value metadata
3940
- Optimized for cache `HIT`s
4041
- Easy error handling
@@ -44,7 +45,6 @@ It is advisable to use another solution if you have the option!
4445

4546
- Toggleable in-memory LRU cache
4647
- Optional tracking of last-access timestamps
47-
- Included cache eviction (LRU/FIFO)
4848
- Built-in cache integrity checks
4949

5050
## Documentation

src/cache.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ pub(crate) struct Options {
3030
pub(crate) wbuff_sz: usize,
3131
}
3232

33-
/// The main component of `forceps`, acts as the API for interacting with the on-disk API.
33+
/// The main component of `forceps`, and acts as the API for interacting with the on-disk cache.
3434
///
35-
/// This structure exposes `read`, `write`, and misc metadata operations. `read` and `write` are
36-
/// both async, whereas all metadata operations are sync. See [`CacheBuilder`](crate::CacheBuilder)
37-
/// for all customization options.
35+
/// This structure includes the async `read`, `write`, and `remove` operations which are the basic
36+
/// operations of the cache. It also includes some misc functions to interact with metadata and
37+
/// evict items from the cache.
38+
///
39+
/// # Eviction
40+
///
41+
/// This cache can evict items with a number of different eviction algorithms. To see more, see
42+
/// [`evict_with`] and the [`evictors`] module.
3843
///
3944
/// # Examples
4045
///
@@ -49,6 +54,9 @@ pub(crate) struct Options {
4954
/// .unwrap();
5055
/// # }
5156
/// ```
57+
///
58+
/// [`evict_with`]: #method.evict_with
59+
/// [`evictors`]: crate::evictors
5260
#[derive(Debug)]
5361
pub struct Cache {
5462
meta: MetaDb,

src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//! - Asynchronous APIs
1515
//! - Fast and reliable reading/writing
1616
//! - Tuned for large-file databases
17+
//! - Included cache eviction (LRU/FIFO)
1718
//! - Easily accessible value metadata
1819
//! - Optimized for cache `HIT`s
1920
//! - Easy error handling
@@ -31,9 +32,9 @@
3132
//!
3233
//! # Examples
3334
//!
34-
//! ```rust
35-
//! # #[tokio::main(flavor = "current_thread")]
36-
//! # async fn main() {
35+
//! ```rust,no_run
36+
//! #[tokio::main]
37+
//! async fn main() {
3738
//! use forceps::Cache;
3839
//!
3940
//! let cache = Cache::new("./cache")
@@ -44,7 +45,7 @@
4445
//! cache.write(b"MY_KEY", b"Hello World").await.unwrap();
4546
//! let data = cache.read(b"MY_KEY").await.unwrap();
4647
//! assert_eq!(data.as_ref(), b"Hello World");
47-
//! # }
48+
//! }
4849
//! ```
4950
5051
#![warn(missing_docs)]

0 commit comments

Comments
 (0)