ConnectionManagerContext

Trait ConnectionManagerContext 

Source
pub trait ConnectionManagerContext:
    Send
    + Sync
    + 'static
    + Sized {
    type ConnectionInfo: ConnectionInfo;

    // Required methods
    fn connection_manager() -> &'static ConnectionManager<Self::ConnectionInfo>;
    fn state_cache(    ) -> &'static LocalKey<RefCell<Cache<&'static ArcSwapOption<ConnectionState>, Option<Arc<ConnectionState>>>>>;

    // Provided methods
    fn get_connection() -> ManagedConnection<Self> { ... }
    fn client() -> &'static RedisResult<Client> { ... }
    fn get_db() -> i64 { ... }
    fn with_state<T>(with_fn: fn(&Option<Arc<ConnectionState>>) -> T) -> T { ... }
}

Required Associated Types§

Required Methods§

Source

fn connection_manager() -> &'static ConnectionManager<Self::ConnectionInfo>

Source

fn state_cache() -> &'static LocalKey<RefCell<Cache<&'static ArcSwapOption<ConnectionState>, Option<Arc<ConnectionState>>>>>

Provided Methods§

Source

fn get_connection() -> ManagedConnection<Self>

Source

fn client() -> &'static RedisResult<Client>

Source

fn get_db() -> i64

Source

fn with_state<T>(with_fn: fn(&Option<Arc<ConnectionState>>) -> T) -> T

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§