Trait reool::FromRedisValue [−][src]
This trait is used to convert a redis value into a more appropriate
type. While a redis Value
can represent any response that comes
back from the redis server, usually you want to map this into something
that works better in rust. For instance you might want to convert the
return value into a String
or an integer.
This trait is well supported throughout the library and you can implement it for your own types if you want.
In addition to what you can see from the docs, this is also implemented
for tuples up to size 12 and for Vec
Required methods
pub fn from_redis_value(v: &Value) -> Result<Self, RedisError>
[src]
Given a redis Value
this attempts to convert it into the given
destination type. If that fails because it’s not compatible an
appropriate error is generated.
Provided methods
pub fn from_redis_values(
items: &[Value]
) -> Result<Vec<Self, Global>, RedisError>
[src]
items: &[Value]
) -> Result<Vec<Self, Global>, RedisError>
Similar to from_redis_value
but constructs a vector of objects
from another vector of values. This primarily exists internally
to customize the behavior for vectors of tuples.
Implementations on Foreign Types
impl FromRedisValue for f64
[src]
pub fn from_redis_value(v: &Value) -> Result<f64, RedisError>
[src]
impl FromRedisValue for i8
[src]
pub fn from_redis_value(v: &Value) -> Result<i8, RedisError>
[src]
impl FromRedisValue for String
[src]
pub fn from_redis_value(v: &Value) -> Result<String, RedisError>
[src]
impl FromRedisValue for StreamInfoConsumersReply
[src]
pub fn from_redis_value(
v: &Value
) -> Result<StreamInfoConsumersReply, RedisError>
[src]
v: &Value
) -> Result<StreamInfoConsumersReply, RedisError>
impl<T, S> FromRedisValue for HashSet<T, S> where
T: FromRedisValue + Eq + Hash,
S: BuildHasher + Default,
[src]
T: FromRedisValue + Eq + Hash,
S: BuildHasher + Default,
pub fn from_redis_value(v: &Value) -> Result<HashSet<T, S>, RedisError>
[src]
impl FromRedisValue for ()
[src]
pub fn from_redis_value(_v: &Value) -> Result<(), RedisError>
[src]
impl FromRedisValue for u32
[src]
pub fn from_redis_value(v: &Value) -> Result<u32, RedisError>
[src]
impl FromRedisValue for StreamClaimReply
[src]
pub fn from_redis_value(v: &Value) -> Result<StreamClaimReply, RedisError>
[src]
impl FromRedisValue for f32
[src]
pub fn from_redis_value(v: &Value) -> Result<f32, RedisError>
[src]
impl<T> FromRedisValue for Option<T> where
T: FromRedisValue,
[src]
T: FromRedisValue,
pub fn from_redis_value(v: &Value) -> Result<Option<T>, RedisError>
[src]
impl FromRedisValue for StreamPendingCountReply
[src]
pub fn from_redis_value(
v: &Value
) -> Result<StreamPendingCountReply, RedisError>
[src]
v: &Value
) -> Result<StreamPendingCountReply, RedisError>
impl FromRedisValue for u8
[src]
pub fn from_redis_value(v: &Value) -> Result<u8, RedisError>
[src]
pub fn from_byte_vec(vec: &[u8]) -> Option<Vec<u8, Global>>
[src]
impl FromRedisValue for usize
[src]
pub fn from_redis_value(v: &Value) -> Result<usize, RedisError>
[src]
impl FromRedisValue for i128
[src]
pub fn from_redis_value(v: &Value) -> Result<i128, RedisError>
[src]
impl FromRedisValue for AclInfo
[src]
pub fn from_redis_value(v: &Value) -> Result<AclInfo, RedisError>
[src]
impl FromRedisValue for RadiusSearchResult
[src]
pub fn from_redis_value(v: &Value) -> Result<RadiusSearchResult, RedisError>
[src]
impl<T> FromRedisValue for Coord<T> where
T: FromRedisValue,
[src]
T: FromRedisValue,
pub fn from_redis_value(v: &Value) -> Result<Coord<T>, RedisError>
[src]
impl FromRedisValue for StreamInfoStreamReply
[src]
pub fn from_redis_value(v: &Value) -> Result<StreamInfoStreamReply, RedisError>
[src]
impl FromRedisValue for i16
[src]
pub fn from_redis_value(v: &Value) -> Result<i16, RedisError>
[src]
impl FromRedisValue for isize
[src]
pub fn from_redis_value(v: &Value) -> Result<isize, RedisError>
[src]
impl FromRedisValue for StreamPendingReply
[src]
pub fn from_redis_value(v: &Value) -> Result<StreamPendingReply, RedisError>
[src]
impl FromRedisValue for i64
[src]
pub fn from_redis_value(v: &Value) -> Result<i64, RedisError>
[src]
impl FromRedisValue for StreamReadReply
[src]
pub fn from_redis_value(v: &Value) -> Result<StreamReadReply, RedisError>
[src]
impl FromRedisValue for u64
[src]
pub fn from_redis_value(v: &Value) -> Result<u64, RedisError>
[src]
impl<K, V, S> FromRedisValue for HashMap<K, V, S> where
S: BuildHasher + Default,
K: FromRedisValue + Eq + Hash,
V: FromRedisValue,
[src]
S: BuildHasher + Default,
K: FromRedisValue + Eq + Hash,
V: FromRedisValue,
pub fn from_redis_value(v: &Value) -> Result<HashMap<K, V, S>, RedisError>
[src]
impl FromRedisValue for u16
[src]
pub fn from_redis_value(v: &Value) -> Result<u16, RedisError>
[src]
impl FromRedisValue for StreamRangeReply
[src]
pub fn from_redis_value(v: &Value) -> Result<StreamRangeReply, RedisError>
[src]
impl<K, V> FromRedisValue for BTreeMap<K, V> where
K: FromRedisValue + Eq + Hash + Ord,
V: FromRedisValue,
[src]
K: FromRedisValue + Eq + Hash + Ord,
V: FromRedisValue,
pub fn from_redis_value(v: &Value) -> Result<BTreeMap<K, V>, RedisError>
[src]
impl<T> FromRedisValue for Vec<T, Global> where
T: FromRedisValue,
[src]
T: FromRedisValue,
pub fn from_redis_value(v: &Value) -> Result<Vec<T, Global>, RedisError>
[src]
impl FromRedisValue for bool
[src]
pub fn from_redis_value(v: &Value) -> Result<bool, RedisError>
[src]
impl FromRedisValue for InfoDict
[src]
pub fn from_redis_value(v: &Value) -> Result<InfoDict, RedisError>
[src]
impl FromRedisValue for i32
[src]
pub fn from_redis_value(v: &Value) -> Result<i32, RedisError>
[src]
impl FromRedisValue for u128
[src]
pub fn from_redis_value(v: &Value) -> Result<u128, RedisError>
[src]
impl FromRedisValue for StreamInfoGroupsReply
[src]
pub fn from_redis_value(v: &Value) -> Result<StreamInfoGroupsReply, RedisError>
[src]
impl<T> FromRedisValue for BTreeSet<T> where
T: FromRedisValue + Eq + Hash + Ord,
[src]
T: FromRedisValue + Eq + Hash + Ord,