pub struct RedisConnection { /* private fields */ }Expand description
A connection to a Redis server
Implementations§
Source§impl RedisConnection
impl RedisConnection
Sourcepub async fn connect(
host: &str,
port: u16,
config: ConnectionConfig,
) -> RedisResult<Self>
pub async fn connect( host: &str, port: u16, config: ConnectionConfig, ) -> RedisResult<Self>
Connect to a Redis server
Sourcepub async fn execute_command(
&mut self,
command: &str,
args: &[RespValue],
) -> RedisResult<RespValue>
pub async fn execute_command( &mut self, command: &str, args: &[RespValue], ) -> RedisResult<RespValue>
Execute a command and return the response
Sourcepub async fn detect_topology(&mut self) -> RedisResult<TopologyType>
pub async fn detect_topology(&mut self) -> RedisResult<TopologyType>
Detect the topology type of the Redis server
Sourcepub async fn select_database(&mut self, db: u8) -> RedisResult<()>
pub async fn select_database(&mut self, db: u8) -> RedisResult<()>
Select a database (only works in standalone mode)
Auto Trait Implementations§
impl !Freeze for RedisConnection
impl RefUnwindSafe for RedisConnection
impl Send for RedisConnection
impl Sync for RedisConnection
impl Unpin for RedisConnection
impl UnwindSafe for RedisConnection
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