pub struct SingleInit {
pub client: Client,
pub conns_count: ConnectionsCount,
pub reconnect_behavior: ReconnectBehavior,
}Expand description
An Init Struct to create a customized CiseauxSingle connections pool. This is like a Builder, but using public fields instead of functions
Fields§
§client: ClientThe redis-rs Client CiseauxSingle will use
conns_count: ConnectionsCountBy default, 4 connections per Thread
reconnect_behavior: ReconnectBehaviorBy default, Instant Retry
Implementations§
Source§impl SingleInit
impl SingleInit
Sourcepub fn new(client: Client) -> SingleInit
pub fn new(client: Client) -> SingleInit
This create a SingleInit with default settings and the provided redis::Client
Sourcepub fn default_localhost() -> SingleInit
pub fn default_localhost() -> SingleInit
Like SingleInit::new, but also opens a redis::Client on localhost (With redis default port : 6379)
Sourcepub async fn build(self) -> Result<CiseauxSingle, RedisError>
pub async fn build(self) -> Result<CiseauxSingle, RedisError>
Asynchronously creates multiple connexions to a Redis instance
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SingleInit
impl RefUnwindSafe for SingleInit
impl Send for SingleInit
impl Sync for SingleInit
impl Unpin for SingleInit
impl UnwindSafe for SingleInit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more