Skip to main content

Module redis

Module redis 

Source
Expand description

Redis key, hash and set store.

RedisStore wraps a cloneable [redis::aio::ConnectionManager]. It is a specialised data API: relational plans are executed by the SQLite and PostgreSQL adapters. RedisStore::capabilities rejects every relational Feature before any I/O.

Keys are strings. A prefix (for example "cache:") is prepended as-is, so include the separator in the prefix when one is wanted. Values are UTF-8. Time-to-live is expressed in milliseconds (PX / PEXPIRE / PTTL); a duration below one millisecond is rejected before a command is sent.

use siderite_backends::redis::RedisStore;
use siderite_orm::{BackendKind, Feature, OrmError};

let err = RedisStore::require(Feature::Joins).unwrap_err();
assert!(matches!(
    OrmError::from(err),
    OrmError::Capability(siderite_orm::BackendCapabilityError::Unsupported {
        backend: BackendKind::Redis,
        feature: Feature::Joins,
    })
));

Structs§

MarkerAdmission
Arguments of RedisStore::admit_marker. Keys are logical (the store prefix is applied); values are the strings stored as-is.
RedisStore
Cloneable Redis client.

Enums§

MarkerReply
What RedisStore::admit_marker decided.
RedisError
Failure from RedisStore.
Ttl
Remaining lifetime of a key, from PTTL.