pub struct RedisGeneric<T> { /* private fields */ }

Implementations§

source§

impl<T> RedisGeneric<T>

source

pub fn new(value: T, client: Client, field_name: String) -> RedisGeneric<T>

The new method creates a new instance of the type.

Example
use types::i32;
use types::BackedType;

let client = redis::Client::open("redis://localhost:6379").unwrap();
let mut i32 = i32::new(1, client.clone(), "test_add".to_string());
i32 = i32 + i32::new(2, client, "test_add2".to_string());
assert_eq!(i32, 3);
source

pub fn set(self, value: T) -> Selfwhere T: ToRedisArgs,

The set method sets the value of the type.

source

pub fn get(&self) -> &T

The get method returns a reference to the value stored in the type.

Example
use types::i32;
use types::BackedType;

let client = redis::Client::open("redis://localhost:6379").unwrap();
let mut i32 = i32::new(1, client.clone(), "test_add".to_string());
i32 = i32 + i32::new(2, client, "test_add2".to_string());
assert_eq!(i32.get(), &3);
source

pub fn into_inner(self) -> T

The into_inner method returns the inner value of the type. This method consumes the type.

Example
use types::i32;
use types::BackedType;

let client = redis::Client::open("redis://localhost:6379").unwrap();
let mut i32 = i32::new(1, client.clone(), "test_add".to_string());
i32 = i32 + i32::new(2, client, "test_add2".to_string());
let i32_inner = i32.into_inner();
assert_eq!(i32_inner, 3);

Trait Implementations§

source§

impl Add<&RedisGeneric<String>> for TString

§

type Output = RedisGeneric<String>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &TString) -> Self::Output

Performs the + operation. Read more
source§

impl<T> Add<RedisGeneric<T>> for RedisGeneric<T>where T: Add<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the + operator.
source§

fn add(self, rhs: RedisGeneric<T>) -> Self::Output

Performs the + operation. Read more
source§

impl<T> Add<T> for RedisGeneric<T>where T: Add<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the + operator.
source§

fn add(self, rhs: T) -> Self::Output

Performs the + operation. Read more
source§

impl AddAssign<&RedisGeneric<String>> for TString

source§

fn add_assign(&mut self, rhs: &TString)

Performs the += operation. Read more
source§

impl<T> AddAssign<RedisGeneric<T>> for RedisGeneric<T>where T: AddAssign + ToRedisArgs,

source§

fn add_assign(&mut self, rhs: RedisGeneric<T>)

Performs the += operation. Read more
source§

impl<T> AddAssign<T> for RedisGeneric<T>where T: AddAssign + ToRedisArgs,

source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
source§

impl<T> BackedType<T> for RedisGeneric<T>

source§

fn get_conn(&self) -> Connection

The get_conn method returns a mutable reference to the redis::Connection.
source§

fn get(&self) -> &T

The get method returns a reference to the value stored in the type.
source§

impl<T> BitAnd<RedisGeneric<T>> for RedisGeneric<T>where T: BitAnd<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: RedisGeneric<T>) -> Self::Output

Performs the & operation. Read more
source§

impl<T> BitAnd<T> for RedisGeneric<T>where T: BitAnd<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: T) -> Self::Output

Performs the & operation. Read more
source§

impl<T> BitOr<RedisGeneric<T>> for RedisGeneric<T>where T: BitOr<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: RedisGeneric<T>) -> Self::Output

Performs the | operation. Read more
source§

impl<T> BitOr<T> for RedisGeneric<T>where T: BitOr<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: T) -> Self::Output

Performs the | operation. Read more
source§

impl<T> BitXor<RedisGeneric<T>> for RedisGeneric<T>where T: BitXor<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: RedisGeneric<T>) -> Self::Output

Performs the ^ operation. Read more
source§

impl<T> BitXor<T> for RedisGeneric<T>where T: BitXor<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: T) -> Self::Output

Performs the ^ operation. Read more
source§

impl<T: Debug> Debug for RedisGeneric<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Deref for RedisGeneric<T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T> Div<RedisGeneric<T>> for RedisGeneric<T>where T: Div<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the / operator.
source§

fn div(self, rhs: RedisGeneric<T>) -> Self::Output

Performs the / operation. Read more
source§

impl<T> Div<T> for RedisGeneric<T>where T: Div<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
source§

impl<T> Mul<RedisGeneric<T>> for RedisGeneric<T>where T: Mul<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: RedisGeneric<T>) -> Self::Output

Performs the * operation. Read more
source§

impl<T> Mul<T> for RedisGeneric<T>where T: Mul<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
source§

impl<T> Not for RedisGeneric<T>where T: Not<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl<T: PartialEq> PartialEq<RedisGeneric<T>> for RedisGeneric<T>

source§

fn eq(&self, other: &RedisGeneric<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialEq> PartialEq<T> for RedisGeneric<T>

source§

fn eq(&self, other: &T) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Sub<RedisGeneric<T>> for RedisGeneric<T>where T: Sub<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: RedisGeneric<T>) -> Self::Output

Performs the - operation. Read more
source§

impl<T> Sub<T> for RedisGeneric<T>where T: Sub<Output = T> + ToRedisArgs + Copy,

§

type Output = RedisGeneric<T>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: T) -> Self::Output

Performs the - operation. Read more
source§

impl<T> SubAssign<RedisGeneric<T>> for RedisGeneric<T>where T: SubAssign + ToRedisArgs,

source§

fn sub_assign(&mut self, rhs: RedisGeneric<T>)

Performs the -= operation. Read more
source§

impl<T> SubAssign<T> for RedisGeneric<T>where T: SubAssign + ToRedisArgs,

source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for RedisGeneric<T>where T: RefUnwindSafe,

§

impl<T> Send for RedisGeneric<T>where T: Send,

§

impl<T> Sync for RedisGeneric<T>where T: Sync,

§

impl<T> Unpin for RedisGeneric<T>where T: Unpin,

§

impl<T> UnwindSafe for RedisGeneric<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.