capuchin_crypt

An in-memory persistent cache for Gleam. Expensive to update, cheap to read. If you think you need this, think again — you probably don’t.

Values

pub fn erase(key: String) -> Bool

Erase the value referenced by key.

Returns True if there was a value, False otherwise.

pub fn get(key: String) -> Result(a, Nil)

Retrieve the value referenced by key.

pub fn get_default(key key: String, or default: a) -> a

Retrieve the value referenced by key or default if not present.

pub fn put(key: String, value: a) -> a

Stores the value as referenced by key.

This returns the stored value.

pub fn put_new(key: String, value: a) -> Result(a, a)

Stores the value as referenced by key only if no value is already present.

This returns the stored value.

Search Document