Enum fred::types::RedisValue

source ·
pub enum RedisValue {
    Boolean(bool),
    Integer(i64),
    Double(f64),
    String(Str),
    Bytes(Bytes),
    Null,
    Queued,
    Map(RedisMap),
    Array(Vec<RedisValue>),
}
Expand description

A value used in a Redis command.

Variants§

§

Boolean(bool)

A boolean value.

§

Integer(i64)

An integer value.

§

Double(f64)

A double floating point number.

§

String(Str)

A string value.

§

Bytes(Bytes)

A byte array value.

§

Null

A nil value.

§

Queued

A special value used to indicate a MULTI block command was received by the server.

§

Map(RedisMap)

A map of key/value pairs, primarily used in RESP3 mode.

§

Array(Vec<RedisValue>)

An ordered list of values.

In RESP2 mode the server usually sends map structures as an array of key/value pairs.

Implementations§

source§

impl RedisValue

source

pub fn from_static(b: &'static [u8]) -> Self

Create a new RedisValue::Bytes from a static byte slice without copying.

source

pub fn from_static_str(s: &'static str) -> Self

Create a new RedisValue::String from a static str without copying.

source

pub fn new_ok() -> Self

Create a new RedisValue with the OK status.

source

pub fn is_ok(&self) -> bool

Whether the value is a simple string OK value.

source

pub fn into_integer(self) -> Result<RedisValue, RedisValue>

Attempt to convert the value into an integer, returning the original string as an error if the parsing fails.

source

pub fn kind(&self) -> RedisValueKind

Read the type of the value without any associated data.

source

pub fn is_null(&self) -> bool

Check if the value is null.

source

pub fn is_integer(&self) -> bool

Check if the value is an integer.

source

pub fn is_string(&self) -> bool

Check if the value is a string.

source

pub fn is_bytes(&self) -> bool

Check if the value is an array of bytes.

source

pub fn is_boolean(&self) -> bool

Whether the value is a boolean value or can be parsed as a boolean value.

source

pub fn is_double(&self) -> bool

Whether the inner value is a double or can be parsed as a double.

source

pub fn is_queued(&self) -> bool

Check if the value is a QUEUED response.

source

pub fn is_aggregate_type(&self) -> bool

Whether the value is an array or map.

source

pub fn is_map(&self) -> bool

Whether the value is a RedisMap.

See is_maybe_map for a function that also checks for arrays that likely represent a map in RESP2 mode.

source

pub fn is_maybe_map(&self) -> bool

Whether the value is a RedisMap or an array with an even number of elements where each even-numbered element is not an aggregate type.

RESP2 and RESP3 encode maps differently, and this function can be used to duck-type maps across protocol versions.

source

pub fn is_array(&self) -> bool

Whether the value is an array.

source

pub fn as_u64(&self) -> Option<u64>

Read and return the inner value as a u64, if possible.

source

pub fn as_i64(&self) -> Option<i64>

Read and return the inner value as a i64, if possible.

source

pub fn as_usize(&self) -> Option<usize>

Read and return the inner value as a usize, if possible.

source

pub fn as_f64(&self) -> Option<f64>

Read and return the inner value as a f64, if possible.

source

pub fn into_string(self) -> Option<String>

Read and return the inner String if the value is a string or scalar value.

source

pub fn into_bytes_str(self) -> Option<Str>

Read and return the inner data as a Str from the bytes crate.

source

pub fn as_bytes_str(&self) -> Option<Str>

Read the inner value as a Str.

source

pub fn as_string(&self) -> Option<String>

Read and return the inner String if the value is a string or scalar value.

Note: this will cast integers and doubles to strings.

source

pub fn as_str(&self) -> Option<Cow<'_, str>>

Read the inner value as a string slice.

Null is returned as "nil" and scalar values are cast to a string.

source

pub fn as_str_lossy(&self) -> Option<Cow<'_, str>>

Read the inner value as a string, using String::from_utf8_lossy on byte slices.

source

pub fn as_bytes(&self) -> Option<&[u8]>

Read the inner value as an array of bytes, if possible.

source

pub fn as_bool(&self) -> Option<bool>

Attempt to convert the value to a bool.

source

pub fn into_map(self) -> Result<RedisMap, RedisError>

Attempt to convert this value to a Redis map if it’s an array with an even number of elements.

source

pub fn into_set(self) -> Result<HashSet<RedisValue>, RedisError>

Convert the array value to a set, if possible.

source

pub fn into_zset_result(self) -> Result<Vec<(RedisValue, f64)>, RedisError>

Convert a RedisValue to Vec<(RedisValue, f64)>, if possible.

source

pub fn into_array(self) -> Vec<RedisValue>

Convert this value to an array if it’s an array or map.

If the value is not an array or map this returns a single-element array containing the current value.

source

pub fn into_owned_bytes(self) -> Option<Vec<u8>>

Convert the value to an array of bytes, if possible.

source

pub fn into_bytes(self) -> Option<Bytes>

Convert the value into a Bytes view.

source

pub fn array_len(&self) -> Option<usize>

Return the length of the inner array if the value is an array.

source

pub fn flatten_array_values(self, depth: usize) -> Self

Flatten adjacent nested arrays to the provided depth.

See the XREAD documentation for an example of when this might be useful.

source

pub fn into_xread_response<K1, I, K2, V>( self ) -> Result<XReadResponse<K1, I, K2, V>, RedisError>
where K1: FromRedisKey + Hash + Eq, K2: FromRedisKey + Hash + Eq, I: FromRedis, V: FromRedis,

Available on crate feature i-streams only.

A utility function to convert the response from XREAD or XREADGROUP into a type with a less verbose type declaration.

This function supports responses in both RESP2 and RESP3 formats.

See the XREAD (or XREADGROUP) documentation for more information.

source

pub fn into_xread_value<I, K, V>( self ) -> Result<Vec<XReadValue<I, K, V>>, RedisError>
where K: FromRedisKey + Hash + Eq, I: FromRedis, V: FromRedis,

Available on crate feature i-streams only.

A utility function to convert the response from XCLAIM, etc into a type with a less verbose type declaration.

This function supports responses in both RESP2 and RESP3 formats.

source

pub fn into_xautoclaim_values<I, K, V>( self ) -> Result<(String, Vec<XReadValue<I, K, V>>), RedisError>
where K: FromRedisKey + Hash + Eq, I: FromRedis, V: FromRedis,

Available on crate feature i-streams only.

A utility function to convert the response from XAUTOCLAIM into a type with a less verbose type declaration.

This function supports responses in both RESP2 and RESP3 formats.

Note: the new (as of Redis 7.x) return value containing message PIDs that were deleted from the PEL are dropped. Callers should use xautoclaim instead if this data is needed.

source

pub fn as_functions(&self, name: &str) -> Result<Vec<Function>, RedisError>

Available on crate feature i-scripts only.

Parse the value as the response from FUNCTION LIST, including only functions with the provided library name.

source

pub fn as_geo_position(&self) -> Result<Option<GeoPosition>, RedisError>

Available on crate feature i-geo only.

Convert the value into a GeoPosition, if possible.

Null values are returned as None to work more easily with the result of the GEOPOS command.

source

pub fn into_geo_radius_result( self, withcoord: bool, withdist: bool, withhash: bool ) -> Result<Vec<GeoRadiusInfo>, RedisError>

Available on crate feature i-geo only.

Parse the value as the response to any of the relevant GEO commands that return an array of GeoRadiusInfo values, such as GEOSEARCH, GEORADIUS`, etc.

source

pub fn take(&mut self) -> RedisValue

Replace this value with RedisValue::Null, returning the original value.

source

pub fn convert<R>(self) -> Result<R, RedisError>
where R: FromRedis,

Attempt to convert this value to any value that implements the FromRedis trait.

source

pub fn can_hash(&self) -> bool

Whether the value can be hashed.

Some use cases require using RedisValue types as keys in a HashMap, etc. Trying to do so with an aggregate type can panic, and this function can be used to more gracefully handle this situation.

source

pub fn into_json(self) -> Result<Value, RedisError>

Available on crate feature serde-json only.

Convert the value to JSON.

Trait Implementations§

source§

impl Clone for RedisValue

source§

fn clone(&self) -> RedisValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RedisValue

source§

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

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

impl<'a> From<&'a [u8]> for RedisValue

source§

fn from(b: &'a [u8]) -> Self

Converts to this type from the input type.
source§

impl From<&Box<[u8]>> for RedisValue

source§

fn from(b: &Box<[u8]>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a String> for RedisValue

source§

fn from(d: &'a String) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a str> for RedisValue

source§

fn from(d: &'a str) -> Self

Converts to this type from the input type.
source§

impl From<()> for RedisValue

source§

fn from(_: ()) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>> From<(A0, A1)> for RedisValue

source§

fn from(value: (A0, A1)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>> From<(A0, A1, A2)> for RedisValue

source§

fn from(value: (A0, A1, A2)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>> From<(A0, A1, A2, A3)> for RedisValue

source§

fn from(value: (A0, A1, A2, A3)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>> From<(A0, A1, A2, A3, A4)> for RedisValue

source§

fn from(value: (A0, A1, A2, A3, A4)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5)> for RedisValue

source§

fn from(value: (A0, A1, A2, A3, A4, A5)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6)> for RedisValue

source§

fn from(value: (A0, A1, A2, A3, A4, A5, A6)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>, A7: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6, A7)> for RedisValue

source§

fn from(value: (A0, A1, A2, A3, A4, A5, A6, A7)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>, A7: Into<RedisValue>, A8: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6, A7, A8)> for RedisValue

source§

fn from(value: (A0, A1, A2, A3, A4, A5, A6, A7, A8)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>, A7: Into<RedisValue>, A8: Into<RedisValue>, A9: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> for RedisValue

source§

fn from(value: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>, A7: Into<RedisValue>, A8: Into<RedisValue>, A9: Into<RedisValue>, A10: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> for RedisValue

source§

fn from(value: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>, A7: Into<RedisValue>, A8: Into<RedisValue>, A9: Into<RedisValue>, A10: Into<RedisValue>, A11: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> for RedisValue

source§

fn from(value: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>, A7: Into<RedisValue>, A8: Into<RedisValue>, A9: Into<RedisValue>, A10: Into<RedisValue>, A11: Into<RedisValue>, A12: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)> for RedisValue

source§

fn from(value: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>, A7: Into<RedisValue>, A8: Into<RedisValue>, A9: Into<RedisValue>, A10: Into<RedisValue>, A11: Into<RedisValue>, A12: Into<RedisValue>, A13: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)> for RedisValue

source§

fn from( value: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) ) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>, A7: Into<RedisValue>, A8: Into<RedisValue>, A9: Into<RedisValue>, A10: Into<RedisValue>, A11: Into<RedisValue>, A12: Into<RedisValue>, A13: Into<RedisValue>, A14: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)> for RedisValue

source§

fn from( value: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) ) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>, A7: Into<RedisValue>, A8: Into<RedisValue>, A9: Into<RedisValue>, A10: Into<RedisValue>, A11: Into<RedisValue>, A12: Into<RedisValue>, A13: Into<RedisValue>, A14: Into<RedisValue>, A15: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)> for RedisValue

source§

fn from( value: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) ) -> Self

Converts to this type from the input type.
source§

impl<A0: Into<RedisValue>, A1: Into<RedisValue>, A2: Into<RedisValue>, A3: Into<RedisValue>, A4: Into<RedisValue>, A5: Into<RedisValue>, A6: Into<RedisValue>, A7: Into<RedisValue>, A8: Into<RedisValue>, A9: Into<RedisValue>, A10: Into<RedisValue>, A11: Into<RedisValue>, A12: Into<RedisValue>, A13: Into<RedisValue>, A14: Into<RedisValue>, A15: Into<RedisValue>, A16: Into<RedisValue>> From<(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)> for RedisValue

source§

fn from( value: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) ) -> Self

Converts to this type from the input type.
source§

impl From<Box<[u8]>> for RedisValue

source§

fn from(b: Box<[u8]>) -> Self

Converts to this type from the input type.
source§

impl From<Bytes> for RedisValue

source§

fn from(b: Bytes) -> Self

Converts to this type from the input type.
source§

impl From<RedisKey> for RedisValue

source§

fn from(d: RedisKey) -> Self

Converts to this type from the input type.
source§

impl From<RedisMap> for RedisValue

source§

fn from(m: RedisMap) -> Self

Converts to this type from the input type.
source§

impl From<StrInner<Bytes>> for RedisValue

source§

fn from(s: Str) -> Self

Converts to this type from the input type.
source§

impl From<String> for RedisValue

source§

fn from(d: String) -> Self

Converts to this type from the input type.
source§

impl From<bool> for RedisValue

source§

fn from(d: bool) -> Self

Converts to this type from the input type.
source§

impl From<f32> for RedisValue

source§

fn from(f: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for RedisValue

source§

fn from(f: f64) -> Self

Converts to this type from the input type.
source§

impl From<i16> for RedisValue

source§

fn from(d: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for RedisValue

source§

fn from(d: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for RedisValue

source§

fn from(d: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for RedisValue

source§

fn from(d: i8) -> Self

Converts to this type from the input type.
source§

impl From<u16> for RedisValue

source§

fn from(d: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for RedisValue

source§

fn from(d: u32) -> Self

Converts to this type from the input type.
source§

impl From<u8> for RedisValue

source§

fn from(d: u8) -> Self

Converts to this type from the input type.
source§

impl<V> FromIterator<V> for RedisValue
where V: Into<RedisValue>,

source§

fn from_iter<I: IntoIterator<Item = V>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl FromRedis for RedisValue

source§

impl FromRedisKey for RedisValue

source§

impl Hash for RedisValue

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RedisValue

source§

fn eq(&self, other: &Self) -> 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<'a, T, const N: usize> TryFrom<&'a [T; N]> for RedisValue

§

type Error = RedisError

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

fn try_from(value: &'a [T; N]) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T, const N: usize> TryFrom<[T; N]> for RedisValue

§

type Error = RedisError

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

fn try_from(value: [T; N]) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<K, V> TryFrom<BTreeMap<K, V>> for RedisValue

§

type Error = RedisError

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

fn try_from(d: BTreeMap<K, V>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<BytesFrame> for RedisValue

§

type Error = RedisError

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

fn try_from(value: Resp3Frame) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<K, V> TryFrom<HashMap<K, V>> for RedisValue

§

type Error = RedisError

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

fn try_from(d: HashMap<K, V>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T> TryFrom<Option<T>> for RedisValue

§

type Error = RedisError

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

fn try_from(d: Option<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<RedisValue> for ClusterInfo

§

type Error = RedisError

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

fn try_from(value: RedisValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<RedisValue> for DatabaseMemoryStats

Available on crate feature i-memory only.
§

type Error = RedisError

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

fn try_from(value: RedisValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<RedisValue> for GeoPosition

§

type Error = RedisError

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

fn try_from(value: RedisValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<RedisValue> for MemoryStats

Available on crate feature i-memory only.
§

type Error = RedisError

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

fn try_from(value: RedisValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<RedisValue> for RedisKey

§

type Error = RedisError

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

fn try_from(value: RedisValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<RedisValue> for SlowlogEntry

§

type Error = RedisError

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

fn try_from(value: RedisValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<RedisValue> for StringOrNumber

§

type Error = RedisError

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

fn try_from(value: RedisValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T> TryFrom<Vec<T>> for RedisValue

§

type Error = RedisError

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

fn try_from(value: Vec<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T> TryFrom<VecDeque<T>> for RedisValue

§

type Error = RedisError

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

fn try_from(value: VecDeque<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<i128> for RedisValue

§

type Error = RedisError

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

fn try_from(d: i128) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<u128> for RedisValue

§

type Error = RedisError

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

fn try_from(d: u128) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<u64> for RedisValue

§

type Error = RedisError

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

fn try_from(d: u64) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<usize> for RedisValue

§

type Error = RedisError

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

fn try_from(d: usize) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for RedisValue

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where 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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more