Struct ntex_redis::RedisConnector
source · pub struct RedisConnector<A, T> { /* private fields */ }
Expand description
Redis connector
Implementations§
source§impl<A> RedisConnector<A, ()>where
A: Address + Clone,
impl<A> RedisConnector<A, ()>where
A: Address + Clone,
sourcepub fn new(address: A) -> RedisConnector<A, Connector<A>>
pub fn new(address: A) -> RedisConnector<A, Connector<A>>
Create new redis connector
source§impl<A, T> RedisConnector<A, T>where
A: Address + Clone,
impl<A, T> RedisConnector<A, T>where
A: Address + Clone,
sourcepub fn memory_pool(self, id: PoolId) -> Self
pub fn memory_pool(self, id: PoolId) -> Self
Set memory pool.
Use specified memory pool for memory allocations. By default P7 memory pool is used.
sourcepub fn connector<U>(self, connector: U) -> RedisConnector<A, U>where
U: Service<Connect<A>, Error = ConnectError>,
IoBoxed: From<U::Response>,
pub fn connector<U>(self, connector: U) -> RedisConnector<A, U>where
U: Service<Connect<A>, Error = ConnectError>,
IoBoxed: From<U::Response>,
Use custom connector
source§impl<A, T> RedisConnector<A, T>where
A: Address + Clone,
T: Service<Connect<A>, Error = ConnectError>,
IoBoxed: From<T::Response>,
impl<A, T> RedisConnector<A, T>where
A: Address + Clone,
T: Service<Connect<A>, Error = ConnectError>,
IoBoxed: From<T::Response>,
sourcepub async fn connect(&self) -> Result<Client, ConnectError>
pub async fn connect(&self) -> Result<Client, ConnectError>
Connect to redis server and create shared client
sourcepub async fn connect_simple(&self) -> Result<SimpleClient, ConnectError>
pub async fn connect_simple(&self) -> Result<SimpleClient, ConnectError>
Connect to redis server and create simple client