fix (backend-rs): fix doc comments
This commit is contained in:
parent
7de36a2d43
commit
2b31b55cf3
1 changed files with 4 additions and 2 deletions
6
packages/backend-rs/src/cache/redis.rs
vendored
6
packages/backend-rs/src/cache/redis.rs
vendored
|
@ -110,12 +110,13 @@ pub async fn set<V: for<'a> Deserialize<'a> + Serialize>(
|
|||
///
|
||||
/// ```
|
||||
/// # use backend_rs::cache;
|
||||
/// use chrono::Duration;
|
||||
/// # async fn f() -> Result<(), Box<dyn std::error::Error>> {
|
||||
/// let key = "banana";
|
||||
/// let data = "I want to cache this string".to_owned();
|
||||
///
|
||||
/// // set cache
|
||||
/// cache::set(key, &data, 10).await?;
|
||||
/// cache::set(key, &data, Duration::seconds(10)).await?;
|
||||
///
|
||||
/// // get cache
|
||||
/// let cached_data = cache::get::<String>(key).await?;
|
||||
|
@ -149,12 +150,13 @@ pub async fn get<V: for<'a> Deserialize<'a> + Serialize>(key: &str) -> Result<Op
|
|||
///
|
||||
/// ```
|
||||
/// # use backend_rs::cache;
|
||||
/// use chrono::Duration;
|
||||
/// # async fn f() -> Result<(), Box<dyn std::error::Error>> {
|
||||
/// let key = "chocolate";
|
||||
/// let value = "I want to cache this string".to_owned();
|
||||
///
|
||||
/// // set cache
|
||||
/// cache::set(key, &value, 10).await?;
|
||||
/// cache::set(key, &value, Duration::seconds(10)).await?;
|
||||
///
|
||||
/// // delete the cache
|
||||
/// cache::delete("foo").await?;
|
||||
|
|
Loading…
Reference in a new issue