[−][src]Struct rsmq_async::RedisBytes
Internal value representing the redis bytes.
It implements TryFrom String and Vec
You can add your custom TryFrom and From implementation in order to make automatically transform you value to yours when executing a command in redis.
As example, the current String implementation:
ⓘ
use std::convert::TryFrom; use rsmq_async::RedisBytes; impl TryFrom<RedisBytes> for String { type Error = Vec<u8>; fn try_from(bytes: RedisBytes) -> Result<Self, Self::Error> { // For the library user, they can just call into_bytes // for getting the original Vec<u8> String::from_utf8(bytes.0).map_err(|e| e.into_bytes()) } }
Implementations
impl RedisBytes
[src]
pub fn into_bytes(self) -> Vec<u8>
[src]
Consumes the value and returns the raw bytes as Vec
Trait Implementations
impl Debug for RedisBytes
[src]
impl From<&'_ [u8]> for RedisBytes
[src]
impl From<&'_ str> for RedisBytes
[src]
pub fn from(t: &str) -> RedisBytes
[src]
impl From<String> for RedisBytes
[src]
pub fn from(t: String) -> RedisBytes
[src]
impl From<Vec<u8, Global>> for RedisBytes
[src]
pub fn from(t: Vec<u8>) -> RedisBytes
[src]
Auto Trait Implementations
impl RefUnwindSafe for RedisBytes
[src]
impl Send for RedisBytes
[src]
impl Sync for RedisBytes
[src]
impl Unpin for RedisBytes
[src]
impl UnwindSafe for RedisBytes
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,