Skip to main content

Module storage

Module storage 

Source
Expand description

Storage module

This module provides multi-backend storage capabilities with support for PostgreSQL, Redis, and Sled. It includes a unified Storage trait and a StorageManager for coordinating multiple backends.

§Example

use processor::storage::{StorageManager, RoutingStrategy};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Create storage manager
    let mut manager = StorageManager::new(RoutingStrategy::CacheAside);

    // Initialize
    manager.initialize().await?;

    // Use storage
    // ...

    // Shutdown
    manager.shutdown().await?;

    Ok(())
}

Re-exports§

pub use traits::Backup;
pub use traits::BackupMetadata;
pub use traits::CacheStorage;
pub use traits::CacheStats;
pub use traits::KeyValueStorage;
pub use traits::Migrator;
pub use traits::Migration;
pub use traits::PubSubStorage;
pub use traits::RelationalStorage;
pub use traits::SqlParam;
pub use traits::SqlResult;
pub use traits::Storage;
pub use traits::Subscriber;
pub use config::MonitoringConfig;
pub use config::PoolConfig;
pub use config::PostgreSQLConfig;
pub use config::RedisConfig;
pub use config::RetryConfig;
pub use config::SSLMode;
pub use config::SledConfig;
pub use config::SledMode;
pub use config::StorageConfig;
pub use error::ErrorCategory;
pub use error::StorageError;
pub use error::StorageResult;
pub use types::Batch;
pub use types::Filter;
pub use types::Operation;
pub use types::Operator;
pub use types::Query;
pub use types::Sort;
pub use types::SortDirection;
pub use types::StorageBackend;
pub use types::StorageEntry;
pub use types::StorageHealth;
pub use types::StorageMetadata;
pub use types::StorageStats;
pub use types::Transaction;
pub use types::TransactionState;
pub use types::Value;
pub use manager::ManagerState;
pub use manager::ManagerStats;
pub use manager::RoutingStrategy;
pub use manager::StorageManager;
pub use postgresql::PostgreSQLStorage;
pub use redis::RedisStorage;
pub use sled_backend::SledStorage;

Modules§

config
Storage configuration
error
Storage error types
manager
Storage Manager
postgresql
PostgreSQL storage backend implementation
redis
Redis storage backend implementation
sled_backend
Sled embedded database storage backend
traits
Storage traits
types
Storage types

Enums§

AnyStorage
Enum wrapper for different storage backend implementations