Skip to main content

Crate sabi_redis

Crate sabi_redis 

Source
Expand description

The sabi data access library for Redis in Rust.

sabi_redis is a Rust crate that provides a streamlined way to access various Redis configurations within the sabi framework. It includes DataSrc and DataConn implementations designed to make your development process more efficient.

This crate supports multiple Redis configurations:

  • Standalone: For a single Redis server.
  • Sentinel: For a Redis Sentinel managed setup, providing automatic failover.
  • Cluster: For a distributed Redis Cluster setup.
  • Pub/Sub: For processing Redis Pub/Sub messages. It includes subscribers for:
    • Standalone: For a standalone Redis server.
    • Sentinel: For a Redis Sentinel setup.
    • Cluster: For a Redis Cluster setup. Each of these subscribers has both synchronous and asynchronous implementations.

Each configuration has both synchronous and asynchronous (compatible with tokio) implementations, which can be enabled via features.

§Features

To use this crate, enable the features corresponding to your Redis setup and preferred execution model:

  • standalone-sync (default): Synchronous connection to a standalone Redis server.
  • standalone-async: Asynchronous connection to a standalone Redis server.
  • sentinel-sync: Synchronous connection to a Redis Sentinel setup.
  • sentinel-async: Asynchronous connection to a Redis Sentinel setup.
  • cluster-sync: Synchronous connection to a Redis Cluster.
  • cluster-async: Asynchronous connection to a Redis Cluster.

Modules§

clustercluster-sync or cluster-async
This module provides components for connecting to a Redis Cluster.
pubsub
This module provides components for processing Redis Pub/Sub messages.
sentinelsentinel-sync or sentinel-async
This module provides components for connecting to a Redis Sentinel managed setup.

Structs§

RedisAsyncDataConnstandalone-async
A data connection for a standalone Redis server, providing asynchronous operations.
RedisAsyncDataSrcstandalone-async
A data source for standalone Redis, used to initialize and provide RedisAsyncDataConn instances.
RedisDataConnstandalone-sync
A data connection for a standalone Redis server, providing synchronous operations.
RedisDataSrcstandalone-sync
A data source for standalone Redis, used to initialize and provide RedisDataConn instances.

Enums§

RedisAsyncErrorstandalone-async
The error type for asynchronous Redis operations.
RedisSyncErrorstandalone-sync
The error type for synchronous Redis operations.