Struct redis_rs::connection::Connection[][src]

pub struct Connection<'a> {
    pub host: &'a str,
    pub port: u32,
}

Holds connection information for the redis server

Fields

host: &'a str

The server host

port: u32

The server port

Implementations

impl<'a> Connection<'a>[src]

pub fn new(host: &'a str, port: u32) -> Connection<'_>[src]

Create a new Connection

pub fn default() -> Connection<'a>[src]

Create a default connection on localhost:6379. Good for testing local connections

pub fn send(&self, command: &str) -> Result<Response, RedisError>[src]

Send a raw request string to the redis server

pub fn send_get(&self, key: &str) -> Result<Response, RedisError>[src]

Send a get request to fetch a specified key

pub fn echo(&self, string: &str) -> Result<Response, RedisError>[src]

Send an echo request. This is great for health checking the server

pub fn send_set(&self, key: &str, value: &str) -> Result<Response, RedisError>[src]

Send a set request to create a new key with value value

Auto Trait Implementations

impl<'a> RefUnwindSafe for Connection<'a>

impl<'a> Send for Connection<'a>

impl<'a> Sync for Connection<'a>

impl<'a> Unpin for Connection<'a>

impl<'a> UnwindSafe for Connection<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.