pub enum OwnedFrame {
Show 16 variants
BlobString {
data: Vec<u8>,
attributes: Option<OwnedAttributes>,
},
BlobError {
data: Vec<u8>,
attributes: Option<OwnedAttributes>,
},
SimpleString {
data: Vec<u8>,
attributes: Option<OwnedAttributes>,
},
SimpleError {
data: String,
attributes: Option<OwnedAttributes>,
},
Boolean {
data: bool,
attributes: Option<OwnedAttributes>,
},
Null,
Number {
data: i64,
attributes: Option<OwnedAttributes>,
},
Double {
data: f64,
attributes: Option<OwnedAttributes>,
},
BigNumber {
data: Vec<u8>,
attributes: Option<OwnedAttributes>,
},
VerbatimString {
data: Vec<u8>,
format: VerbatimStringFormat,
attributes: Option<OwnedAttributes>,
},
Array {
data: Vec<OwnedFrame>,
attributes: Option<OwnedAttributes>,
},
Map {
data: FrameMap<OwnedFrame, OwnedFrame>,
attributes: Option<OwnedAttributes>,
},
Set {
data: FrameSet<OwnedFrame>,
attributes: Option<OwnedAttributes>,
},
Push {
data: Vec<OwnedFrame>,
attributes: Option<OwnedAttributes>,
},
Hello {
version: RespVersion,
auth: Option<(String, String)>,
setname: Option<String>,
},
ChunkedString(Vec<u8>),
}resp3 only.Expand description
An enum describing a RESP3 frame that uses owned byte containers.
Variants§
BlobString
A blob of bytes.
BlobError
A blob representing an error.
SimpleString
A small string.
The internal data type is Vec<u8> in order to support callers that use this interface to parse a MONITOR
stream.
SimpleError
A small string representing an error.
Boolean
A boolean type.
Null
A null type.
Number
A signed 64-bit integer.
Double
A signed 64-bit floating point number.
BigNumber
A large number not representable as a Number or Double.
This library does not attempt to parse this.
VerbatimString
A string to be displayed without any escaping or filtering.
Array
An array of frames.
Map
An unordered map of key-value pairs.
According to the spec keys can be any other RESP3 data type. However, it doesn’t make sense to implement Hash
for certain aggregate types. The can_hash function can be used to
detect this.
Set
An unordered collection of other frames with a uniqueness constraint.
Push
Out-of-band data.
Hello
A special frame type used when first connecting to the server to describe the protocol version and optional credentials.
ChunkedString(Vec<u8>)
One chunk of a streaming blob.
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.
Trait Implementations§
Source§impl Clone for OwnedFrame
impl Clone for OwnedFrame
Source§fn clone(&self) -> OwnedFrame
fn clone(&self) -> OwnedFrame
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OwnedFrame
impl Debug for OwnedFrame
Source§impl From<bool> for OwnedFrame
impl From<bool> for OwnedFrame
Source§impl From<f64> for OwnedFrame
impl From<f64> for OwnedFrame
Source§impl From<i64> for OwnedFrame
impl From<i64> for OwnedFrame
Source§impl<T, const N: usize> FromResp3<OwnedFrame> for [T; N]where
T: FromResp3<OwnedFrame>,
Available on crate feature convert only.
impl<T, const N: usize> FromResp3<OwnedFrame> for [T; N]where
T: FromResp3<OwnedFrame>,
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<[T; N], RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<[T; N], RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for ()
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for ()
convert only.Source§fn from_frame(_: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(_: OwnedFrame) -> Result<Self, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl<K, V, S> FromResp3<OwnedFrame> for HashMap<K, V, S>
Available on crate feature convert only.
impl<K, V, S> FromResp3<OwnedFrame> for HashMap<K, V, S>
convert only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl<V, S> FromResp3<OwnedFrame> for HashSet<V, S>
Available on crate feature convert only.
impl<V, S> FromResp3<OwnedFrame> for HashSet<V, S>
convert only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl<T> FromResp3<OwnedFrame> for Option<T>where
T: FromResp3<OwnedFrame>,
Available on crate feature convert only.
impl<T> FromResp3<OwnedFrame> for Option<T>where
T: FromResp3<OwnedFrame>,
convert only.Source§fn from_frame(frame: OwnedFrame) -> Result<Option<T>, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Option<T>, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for OwnedFrame
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for OwnedFrame
convert only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for String
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for String
convert only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl<T> FromResp3<OwnedFrame> for Vec<T>where
T: FromResp3<OwnedFrame>,
Available on crate feature convert only.
impl<T> FromResp3<OwnedFrame> for Vec<T>where
T: FromResp3<OwnedFrame>,
convert only.Source§fn from_frame(frame: OwnedFrame) -> Result<Vec<T>, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Vec<T>, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for bool
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for bool
convert only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for f32
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for f32
convert only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for f64
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for f64
convert only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for i128
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for i128
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<i128, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<i128, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for i16
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for i16
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<i16, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<i16, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for i32
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for i32
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<i32, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<i32, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for i64
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for i64
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<i64, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<i64, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for i8
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for i8
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<i8, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<i8, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for isize
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for isize
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<isize, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<isize, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for u128
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for u128
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<u128, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<u128, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for u16
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for u16
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<u16, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<u16, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for u32
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for u32
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<u32, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<u32, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for u64
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for u64
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<u64, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<u64, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for u8
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for u8
convert only.Source§fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: OwnedFrame) -> Result<Self, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl FromResp3<OwnedFrame> for usize
Available on crate feature convert only.
impl FromResp3<OwnedFrame> for usize
convert only.Source§fn from_frame(value: OwnedFrame) -> Result<usize, RedisProtocolError>
fn from_frame(value: OwnedFrame) -> Result<usize, RedisProtocolError>
Source§fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
fn from_frames(frames: Vec<F>) -> Result<Vec<Self>, RedisProtocolError>
Source§impl Hash for OwnedFrame
impl Hash for OwnedFrame
Source§impl PartialEq for OwnedFrame
impl PartialEq for OwnedFrame
Source§impl Resp3Frame for OwnedFrame
impl Resp3Frame for OwnedFrame
type Attributes = HashMap<OwnedFrame, OwnedFrame>
Source§fn from_buffer(
target: FrameKind,
buf: impl IntoIterator<Item = Self>,
attributes: Option<Self::Attributes>,
) -> Result<Self, RedisProtocolError>
fn from_buffer( target: FrameKind, buf: impl IntoIterator<Item = Self>, attributes: Option<Self::Attributes>, ) -> Result<Self, RedisProtocolError>
Source§fn add_attributes(
&mut self,
attributes: Self::Attributes,
) -> Result<(), RedisProtocolError>
fn add_attributes( &mut self, attributes: Self::Attributes, ) -> Result<(), RedisProtocolError>
Source§fn attributes(&self) -> Option<&Self::Attributes>
fn attributes(&self) -> Option<&Self::Attributes>
Source§fn attributes_mut(&mut self) -> Option<&mut Self::Attributes>
fn attributes_mut(&mut self) -> Option<&mut Self::Attributes>
Source§fn take_attributes(&mut self) -> Option<Self::Attributes>
fn take_attributes(&mut self) -> Option<Self::Attributes>
Source§fn new_end_stream() -> Self
fn new_end_stream() -> Self
Source§fn len(&self) -> usize
fn len(&self) -> usize
Source§fn is_end_stream_frame(&self) -> bool
fn is_end_stream_frame(&self) -> bool
Source§fn verbatim_string_format(&self) -> Option<&VerbatimStringFormat>
fn verbatim_string_format(&self) -> Option<&VerbatimStringFormat>
Source§fn as_str(&self) -> Option<&str>
fn as_str(&self) -> Option<&str>
Source§fn to_string(&self) -> Option<String>
fn to_string(&self) -> Option<String>
String if it can be parsed as a UTF-8 string.Source§fn encode_len(&self, int_as_blobstring: bool) -> usize
fn encode_len(&self, int_as_blobstring: bool) -> usize
Source§fn is_normal_pubsub_message(&self) -> bool
fn is_normal_pubsub_message(&self) -> bool
subscribe call.Source§fn is_pattern_pubsub_message(&self) -> bool
fn is_pattern_pubsub_message(&self) -> bool
psubscribe call.Source§fn is_shard_pubsub_message(&self) -> bool
fn is_shard_pubsub_message(&self) -> bool
ssubscribe call.Source§fn is_single_element_vec(&self) -> bool
fn is_single_element_vec(&self) -> bool
convert only.Source§fn pop_or_take(self) -> Self
fn pop_or_take(self) -> Self
convert only.Source§fn is_redirection(&self) -> bool
fn is_redirection(&self) -> bool
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
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>
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>
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