/// Create a context by establishing connection to a server.
Create a context by establishing connection to a server.
Create a context by establishing connection to a server .
pub fn new(host: &str, port: usize) -> Result<Context> {
        let context = Context {
            raw: unsafe {
                let raw = ffi::redisConnect(str_to_cstr!(host).as_ptr(), port as c_int);
                if raw.is_null() {
                    raise!("failed to create a context");
                }
                raw
            },
            phantom: PhantomData,
        };
        success!(context);
        Ok(context)
    }
pub fn new ( host : & str , port : usize ) -> Result < Context > { let context = Context { raw : unsafe { let raw = ffi :: redisConnect ( str_to_cstr ! ( host ) . as_ptr ( ) , port as c_int ) ; if raw . is_null ( ) { raise ! ( " " ) ; } raw } , phantom : PhantomData , } ; success ! ( context ) ; Ok ( context ) }
Create a context by establishing connection to a server.
Create a context by establishing connection to a server .
host
&str
port
usize