Enum redis_protocol::resp3::types::BytesFrame
source · pub enum BytesFrame {
Show 16 variants
BlobString {
data: Bytes,
attributes: Option<BytesAttributes>,
},
BlobError {
data: Bytes,
attributes: Option<BytesAttributes>,
},
SimpleString {
data: Bytes,
attributes: Option<BytesAttributes>,
},
SimpleError {
data: Str,
attributes: Option<BytesAttributes>,
},
Boolean {
data: bool,
attributes: Option<BytesAttributes>,
},
Null,
Number {
data: i64,
attributes: Option<BytesAttributes>,
},
Double {
data: f64,
attributes: Option<BytesAttributes>,
},
BigNumber {
data: Bytes,
attributes: Option<BytesAttributes>,
},
VerbatimString {
data: Bytes,
format: VerbatimStringFormat,
attributes: Option<BytesAttributes>,
},
Array {
data: Vec<BytesFrame>,
attributes: Option<BytesAttributes>,
},
Map {
data: FrameMap<BytesFrame, BytesFrame>,
attributes: Option<BytesAttributes>,
},
Set {
data: FrameSet<BytesFrame>,
attributes: Option<BytesAttributes>,
},
Push {
data: Vec<BytesFrame>,
attributes: Option<BytesAttributes>,
},
Hello {
version: RespVersion,
auth: Option<(Str, Str)>,
setname: Option<Str>,
},
ChunkedString(Bytes),
}resp3 and bytes only.Variants§
BlobString
A blob of bytes.
BlobError
A blob representing an error.
SimpleString
A small string.
The internal data type is Bytes 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(Bytes)
One chunk of a streaming blob.
Implementations§
source§impl BytesFrame
impl BytesFrame
sourcepub fn to_owned_frame(&self) -> OwnedFrame
pub fn to_owned_frame(&self) -> OwnedFrame
Copy the frame contents into a new OwnedFrame.
Trait Implementations§
source§impl Clone for BytesFrame
impl Clone for BytesFrame
source§fn clone(&self) -> BytesFrame
fn clone(&self) -> BytesFrame
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for BytesFrame
impl Debug for BytesFrame
source§impl Encoder<BytesFrame> for Resp3
Available on crate feature codec only.
impl Encoder<BytesFrame> for Resp3
codec only.source§impl From<bool> for BytesFrame
impl From<bool> for BytesFrame
source§impl From<f64> for BytesFrame
impl From<f64> for BytesFrame
source§impl From<i64> for BytesFrame
impl From<i64> for BytesFrame
source§impl<T, const N: usize> FromResp3<BytesFrame> for [T; N]where
T: FromResp3<BytesFrame>,
Available on crate feature convert only.
impl<T, const N: usize> FromResp3<BytesFrame> for [T; N]where
T: FromResp3<BytesFrame>,
convert only.source§fn from_frame(value: BytesFrame) -> Result<[T; N], RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for ()
Available on crate feature convert only.
impl FromResp3<BytesFrame> for ()
convert only.source§fn from_frame(_: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(_: BytesFrame) -> 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<BytesFrame> for Bytes
Available on crate feature convert only.
impl FromResp3<BytesFrame> for Bytes
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for BytesFrame
Available on crate feature convert only.
impl FromResp3<BytesFrame> for BytesFrame
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for HashMap<K, V, S>
Available on crate feature convert only.
impl<K, V, S> FromResp3<BytesFrame> for HashMap<K, V, S>
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for HashSet<V, S>
Available on crate feature convert only.
impl<V, S> FromResp3<BytesFrame> for HashSet<V, S>
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for Option<T>where
T: FromResp3<BytesFrame>,
Available on crate feature convert only.
impl<T> FromResp3<BytesFrame> for Option<T>where
T: FromResp3<BytesFrame>,
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Option<T>, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for Str
Available on crate feature convert only.
impl FromResp3<BytesFrame> for Str
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for String
Available on crate feature convert only.
impl FromResp3<BytesFrame> for String
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for Vec<T>where
T: FromResp3<BytesFrame>,
Available on crate feature convert only.
impl<T> FromResp3<BytesFrame> for Vec<T>where
T: FromResp3<BytesFrame>,
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Vec<T>, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for bool
Available on crate feature convert only.
impl FromResp3<BytesFrame> for bool
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for f32
Available on crate feature convert only.
impl FromResp3<BytesFrame> for f32
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for f64
Available on crate feature convert only.
impl FromResp3<BytesFrame> for f64
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for i128
Available on crate feature convert only.
impl FromResp3<BytesFrame> for i128
convert only.source§fn from_frame(value: BytesFrame) -> Result<i128, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for i16
Available on crate feature convert only.
impl FromResp3<BytesFrame> for i16
convert only.source§fn from_frame(value: BytesFrame) -> Result<i16, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for i32
Available on crate feature convert only.
impl FromResp3<BytesFrame> for i32
convert only.source§fn from_frame(value: BytesFrame) -> Result<i32, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for i64
Available on crate feature convert only.
impl FromResp3<BytesFrame> for i64
convert only.source§fn from_frame(value: BytesFrame) -> Result<i64, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for i8
Available on crate feature convert only.
impl FromResp3<BytesFrame> for i8
convert only.source§fn from_frame(value: BytesFrame) -> Result<i8, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for isize
Available on crate feature convert only.
impl FromResp3<BytesFrame> for isize
convert only.source§fn from_frame(value: BytesFrame) -> Result<isize, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for u128
Available on crate feature convert only.
impl FromResp3<BytesFrame> for u128
convert only.source§fn from_frame(value: BytesFrame) -> Result<u128, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for u16
Available on crate feature convert only.
impl FromResp3<BytesFrame> for u16
convert only.source§fn from_frame(value: BytesFrame) -> Result<u16, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for u32
Available on crate feature convert only.
impl FromResp3<BytesFrame> for u32
convert only.source§fn from_frame(value: BytesFrame) -> Result<u32, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for u64
Available on crate feature convert only.
impl FromResp3<BytesFrame> for u64
convert only.source§fn from_frame(value: BytesFrame) -> Result<u64, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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<BytesFrame> for u8
Available on crate feature convert only.
impl FromResp3<BytesFrame> for u8
convert only.source§fn from_frame(frame: BytesFrame) -> Result<Self, RedisProtocolError>
fn from_frame(frame: BytesFrame) -> 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<BytesFrame> for usize
Available on crate feature convert only.
impl FromResp3<BytesFrame> for usize
convert only.source§fn from_frame(value: BytesFrame) -> Result<usize, RedisProtocolError>
fn from_frame(value: BytesFrame) -> 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 BytesFrame
impl Hash for BytesFrame
source§impl PartialEq for BytesFrame
impl PartialEq for BytesFrame
source§fn eq(&self, other: &BytesFrame) -> bool
fn eq(&self, other: &BytesFrame) -> bool
self and other values to be equal, and is used
by ==.source§impl Resp3Frame for BytesFrame
impl Resp3Frame for BytesFrame
source§fn add_attributes(
&mut self,
attributes: Self::Attributes
) -> Result<(), RedisProtocolError>
fn add_attributes( &mut self, attributes: Self::Attributes ) -> Result<(), RedisProtocolError>
Attempt to add attributes to the frame, extending the existing attributes if needed.
type Attributes = HashMap<BytesFrame, BytesFrame>
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 attributes(&self) -> Option<&Self::Attributes>
fn attributes(&self) -> Option<&Self::Attributes>
source§fn take_attributes(&mut self) -> Option<Self::Attributes>
fn take_attributes(&mut 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 new_end_stream() -> Self
fn new_end_stream() -> Self
source§fn len(&self) -> usize
fn len(&self) -> usize
source§fn take(&mut self) -> BytesFrame
fn take(&mut self) -> BytesFrame
self with Null, returning the original value.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.