[−][src]Trait redis::FromRedisValue
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) -> RedisResult<Self>
[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]) -> RedisResult<Vec<Self>>
[src]
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 u8
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<u8>
[src]
pub fn from_byte_vec(vec: &[u8]) -> Option<Vec<u8>>
[src]
impl FromRedisValue for i8
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<i8>
[src]
impl FromRedisValue for i16
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<i16>
[src]
impl FromRedisValue for u16
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<u16>
[src]
impl FromRedisValue for i32
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<i32>
[src]
impl FromRedisValue for u32
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<u32>
[src]
impl FromRedisValue for i64
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<i64>
[src]
impl FromRedisValue for u64
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<u64>
[src]
impl FromRedisValue for i128
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<i128>
[src]
impl FromRedisValue for u128
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<u128>
[src]
impl FromRedisValue for f32
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<f32>
[src]
impl FromRedisValue for f64
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<f64>
[src]
impl FromRedisValue for isize
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<isize>
[src]
impl FromRedisValue for usize
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<usize>
[src]
impl FromRedisValue for bool
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<bool>
[src]
impl FromRedisValue for String
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<String>
[src]
impl<T: FromRedisValue> FromRedisValue for Vec<T>
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<Vec<T>>
[src]
impl<K: FromRedisValue + Eq + Hash, V: FromRedisValue, S: BuildHasher + Default> FromRedisValue for HashMap<K, V, S>
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<HashMap<K, V, S>>
[src]
impl<K: FromRedisValue + Eq + Hash, V: FromRedisValue> FromRedisValue for BTreeMap<K, V> where
K: Ord,
[src]
K: Ord,
pub fn from_redis_value(v: &Value) -> RedisResult<BTreeMap<K, V>>
[src]
impl<T: FromRedisValue + Eq + Hash, S: BuildHasher + Default> FromRedisValue for HashSet<T, S>
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<HashSet<T, S>>
[src]
impl<T: FromRedisValue + Eq + Hash> FromRedisValue for BTreeSet<T> where
T: Ord,
[src]
T: Ord,
pub fn from_redis_value(v: &Value) -> RedisResult<BTreeSet<T>>
[src]
impl FromRedisValue for ()
[src]
pub fn from_redis_value(_v: &Value) -> RedisResult<()>
[src]
impl<T: FromRedisValue> FromRedisValue for Option<T>
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<Option<T>>
[src]
Implementors
impl FromRedisValue for Value
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<Value>
[src]
impl FromRedisValue for StreamPendingReply
[src]
streams
only.pub fn from_redis_value(v: &Value) -> RedisResult<Self>
[src]
impl FromRedisValue for AclInfo
[src]
acl
only.pub fn from_redis_value(v: &Value) -> RedisResult<Self>
[src]
impl FromRedisValue for RadiusSearchResult
[src]
geospatial
only.pub fn from_redis_value(v: &Value) -> RedisResult<Self>
[src]
impl FromRedisValue for StreamClaimReply
[src]
streams
only.pub fn from_redis_value(v: &Value) -> RedisResult<Self>
[src]
impl FromRedisValue for StreamInfoConsumersReply
[src]
streams
only.pub fn from_redis_value(v: &Value) -> RedisResult<Self>
[src]
impl FromRedisValue for StreamInfoGroupsReply
[src]
streams
only.pub fn from_redis_value(v: &Value) -> RedisResult<Self>
[src]
impl FromRedisValue for StreamInfoStreamReply
[src]
streams
only.pub fn from_redis_value(v: &Value) -> RedisResult<Self>
[src]
impl FromRedisValue for StreamPendingCountReply
[src]
streams
only.pub fn from_redis_value(v: &Value) -> RedisResult<Self>
[src]
impl FromRedisValue for StreamRangeReply
[src]
streams
only.pub fn from_redis_value(v: &Value) -> RedisResult<Self>
[src]
impl FromRedisValue for StreamReadReply
[src]
streams
only.pub fn from_redis_value(v: &Value) -> RedisResult<Self>
[src]
impl FromRedisValue for InfoDict
[src]
pub fn from_redis_value(v: &Value) -> RedisResult<InfoDict>
[src]
impl<T: FromRedisValue> FromRedisValue for Coord<T>
[src]
geospatial
only.