Skip to main content

get

Function get 

Source
pub async fn get<T>(key: &str) -> Result<Option<T>, AppError>
Expand description

Returns Ok(None) for a missing or expired key (an ordinary cache miss). A key that exists but whose stored JSON can’t be coerced into T - e.g. reading a key back with an incompatible type than it was put with - is a caller bug, not a miss, so it surfaces as Err(AppError::Internal) rather than silently degrading to None the way Laravel’s own cache would.