Skip to content

Commit

Permalink
Update cache document (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
astoring authored Jan 31, 2024
1 parent 453edcd commit fa772ec
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion crates/cache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,22 @@ impl CachedEntry {
}
}

/// A constructed via `salvo_cache::Cache::builder()`.
/// Cache middleware.
///
/// # Example
///
/// ```
/// use std::time::Duration;
///
/// use salvo_core::Router;
/// use salvo_cache::{Cache, MokaStore, RequestIssuer};
///
/// let cache = Cache::new(
/// MokaStore::builder().time_to_live(Duration::from_secs(60)).build(),
/// RequestIssuer::default(),
/// );
/// let router = Router::new().hoop(cache);
/// ```
#[non_exhaustive]
pub struct Cache<S, I> {
/// Cache store.
Expand Down

0 comments on commit fa772ec

Please sign in to comment.