Struct redis_rs::connection::Connection [−][src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,