pub enum OwnedFrame {
SimpleString(Vec<u8>),
Error(String),
Integer(i64),
BulkString(Vec<u8>),
Array(Vec<OwnedFrame>),
Null,
}
Available on crate feature
resp2
only.Expand description
A RESP2 frame.
Variants§
SimpleString(Vec<u8>)
A RESP2 simple string.
Error(String)
A short string representing an error.
Integer(i64)
A signed 64-bit integer.
BulkString(Vec<u8>)
A byte array.
Array(Vec<OwnedFrame>)
An array of frames,
Null
A null value.
Implementations§
Source§impl OwnedFrame
impl OwnedFrame
Sourcepub fn into_bytes_frame(self) -> BytesFrame
Available on crate feature bytes
only.
pub fn into_bytes_frame(self) -> BytesFrame
bytes
only.Move the frame contents into a new BytesFrame.
Sourcepub fn into_resp3(self) -> Resp3OwnedFrame
pub fn into_resp3(self) -> Resp3OwnedFrame
Convert the frame to RESP3.
For the most part RESP3 is a superset of RESP2, but there is one notable difference with publish-subscribe messages - in RESP3 pubsub arrays have an additional prefix frame with the SimpleString value “pubsub”. This function will add this frame.
Trait Implementations§
Source§impl Clone for OwnedFrame
impl Clone for OwnedFrame
Source§fn clone(&self) -> OwnedFrame
fn clone(&self) -> OwnedFrame
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OwnedFrame
impl Debug for OwnedFrame
Source§impl<T, const N: usize> FromResp2<OwnedFrame> for [T; N]where
T: FromResp2<OwnedFrame>,
Available on crate feature convert
only.
impl<T, const N: usize> FromResp2<OwnedFrame> for [T; N]where
T: FromResp2<OwnedFrame>,
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<[T; N], RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<[T; N], RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for ()
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for ()
Available on crate feature
convert
only.Source§fn from_frame(_: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(_: OwnedFrame) -> Result<Self, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl<K, V, S> FromResp2<OwnedFrame> for HashMap<K, V, S>
Available on crate feature convert
only.
impl<K, V, S> FromResp2<OwnedFrame> for HashMap<K, V, S>
Available on crate feature
convert
only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl<V, S> FromResp2<OwnedFrame> for HashSet<V, S>
Available on crate feature convert
only.
impl<V, S> FromResp2<OwnedFrame> for HashSet<V, S>
Available on crate feature
convert
only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl<T> FromResp2<OwnedFrame> for Option<T>where
T: FromResp2<OwnedFrame>,
Available on crate feature convert
only.
impl<T> FromResp2<OwnedFrame> for Option<T>where
T: FromResp2<OwnedFrame>,
Available on crate feature
convert
only.Source§fn from_frame(frame: OwnedFrame) -> Result<Option<T>, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Option<T>, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for OwnedFrame
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for OwnedFrame
Available on crate feature
convert
only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for String
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for String
Available on crate feature
convert
only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl<T> FromResp2<OwnedFrame> for Vec<T>where
T: FromResp2<OwnedFrame>,
Available on crate feature convert
only.
impl<T> FromResp2<OwnedFrame> for Vec<T>where
T: FromResp2<OwnedFrame>,
Available on crate feature
convert
only.Source§fn from_frame(frame: OwnedFrame) -> Result<Vec<T>, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Vec<T>, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for bool
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for bool
Available on crate feature
convert
only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for f32
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for f32
Available on crate feature
convert
only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for f64
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for f64
Available on crate feature
convert
only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for i128
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for i128
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<i128, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<i128, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for i16
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for i16
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<i16, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<i16, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for i32
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for i32
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<i32, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<i32, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for i64
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for i64
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<i64, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<i64, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for i8
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for i8
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<i8, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<i8, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for isize
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for isize
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<isize, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<isize, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for u128
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for u128
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<u128, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<u128, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for u16
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for u16
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<u16, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<u16, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for u32
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for u32
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<u32, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<u32, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for u64
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for u64
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<u64, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<u64, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for u8
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for u8
Available on crate feature
convert
only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl FromResp2<OwnedFrame> for usize
Available on crate feature convert
only.
impl FromResp2<OwnedFrame> for usize
Available on crate feature
convert
only.Source§fn from_frame(value: OwnedFrame) -> Result<usize, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<usize, RedisProtocolError>
Convert a frame to the destination type.
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Convert multiple frames to the destination type.
Source§impl Hash for OwnedFrame
impl Hash for OwnedFrame
Source§impl PartialEq for OwnedFrame
impl PartialEq for OwnedFrame
Source§impl Resp2Frame for OwnedFrame
impl Resp2Frame for OwnedFrame
Source§fn encode_len(&self, int_as_bulkstring: bool) -> usize
fn encode_len(&self, int_as_bulkstring: bool) -> usize
Read the number of bytes needed to encode this frame.
Source§fn take(&mut self) -> OwnedFrame
fn take(&mut self) -> OwnedFrame
Replace
self
with Null, returning the original value.Source§fn is_normal_pubsub_message(&self) -> bool
fn is_normal_pubsub_message(&self) -> bool
Whether the frame is a message from a
subscribe
call.Source§fn is_pattern_pubsub_message(&self) -> bool
fn is_pattern_pubsub_message(&self) -> bool
Whether the frame is a message from a
psubscribe
call.Source§fn is_shard_pubsub_message(&self) -> bool
fn is_shard_pubsub_message(&self) -> bool
Whether the frame is a message from a
ssubscribe
call.Source§fn is_single_element_vec(&self) -> bool
fn is_single_element_vec(&self) -> bool
Available on crate feature
convert
only.Whether frame is a bulk array with a single element.
Source§fn pop_or_take(self) -> Self
fn pop_or_take(self) -> Self
Available on crate feature
convert
only.Pop an element from the inner array or return the original frame. Read more
Source§fn is_redirection(&self) -> bool
fn is_redirection(&self) -> bool
Whether the frame is a
MOVED
or ASK
redirection.impl Eq for OwnedFrame
impl StructuralPartialEq for OwnedFrame
Auto Trait Implementations§
impl Freeze for OwnedFrame
impl RefUnwindSafe for OwnedFrame
impl Send for OwnedFrame
impl Sync for OwnedFrame
impl Unpin for OwnedFrame
impl UnwindSafe for OwnedFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more