8000 How to "insert_if"? · Issue #525 · moka-rs/moka · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
How to "insert_if"? #525
Open
Open
@ajewellamz

Description

@ajewellamz

I want to write the following

let old_value = cache.get(key)
// do some stuff to create new_value
cache.insert(key, new_value) BUT only if current cache.get(key) is still old_value

Is there a way to do that?

It seems like it must be in the documentation somewhere, but I can't find it.

Many thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0