Enum redis_protocol::resp3::types::OwnedFrame
source · 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§fn eq(&self, other: &OwnedFrame) -> bool
fn eq(&self, other: &OwnedFrame) -> bool
self and other values to be equal, and is used
by ==.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) -> usize
fn encode_len(&self) -> 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.