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§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, 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 BytesFrame
impl StructuralPartialEq for BytesFrame
Auto Trait Implementations§
impl !Freeze for BytesFrame
impl RefUnwindSafe for BytesFrame
impl Send for BytesFrame
impl Sync for BytesFrame
impl Unpin for BytesFrame
impl UnwindSafe for BytesFrame
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