Enum fred::interfaces::Resp3Frame
pub enum Resp3Frame {
Show 16 variants
BlobString {
data: Bytes,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
BlobError {
data: Bytes,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
SimpleString {
data: Bytes,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
SimpleError {
data: StrInner<Bytes>,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
Boolean {
data: bool,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
Null,
Number {
data: i64,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
Double {
data: f64,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
BigNumber {
data: Bytes,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
VerbatimString {
data: Bytes,
format: VerbatimStringFormat,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
Array {
data: Vec<BytesFrame>,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
Map {
data: HashMap<BytesFrame, BytesFrame>,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
Set {
data: HashSet<BytesFrame>,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
Push {
data: Vec<BytesFrame>,
attributes: Option<HashMap<BytesFrame, BytesFrame>>,
},
Hello {
version: RespVersion,
auth: Option<(StrInner<Bytes>, StrInner<Bytes>)>,
setname: Option<StrInner<Bytes>>,
},
ChunkedString(Bytes),
}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.
Fields
version: RespVersionChunkedString(Bytes)
One chunk of a streaming blob.
Implementations§
§impl BytesFrame
impl BytesFrame
pub fn to_owned_frame(&self) -> OwnedFrame
pub fn to_owned_frame(&self) -> OwnedFrame
Copy the frame contents into a new [OwnedFrame].
Trait Implementations§
§impl Clone for BytesFrame
impl Clone for BytesFrame
§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 more§impl Debug for BytesFrame
impl Debug for BytesFrame
§impl From<bool> for BytesFrame
impl From<bool> for BytesFrame
§fn from(value: bool) -> BytesFrame
fn from(value: bool) -> BytesFrame
§impl From<f64> for BytesFrame
impl From<f64> for BytesFrame
§fn from(value: f64) -> BytesFrame
fn from(value: f64) -> BytesFrame
§impl From<i64> for BytesFrame
impl From<i64> for BytesFrame
§fn from(value: i64) -> BytesFrame
fn from(value: i64) -> BytesFrame
§impl Hash for BytesFrame
impl Hash for BytesFrame
§impl PartialEq for BytesFrame
impl PartialEq for BytesFrame
§impl Resp3Frame for BytesFrame
impl Resp3Frame for BytesFrame
§fn add_attributes(
&mut self,
attributes: <BytesFrame as Resp3Frame>::Attributes,
) -> Result<(), RedisProtocolError>
fn add_attributes( &mut self, attributes: <BytesFrame as Resp3Frame>::Attributes, ) -> Result<(), RedisProtocolError>
Attempt to add attributes to the frame, extending the existing attributes if needed.
type Attributes = HashMap<BytesFrame, BytesFrame>
§fn from_buffer(
target: FrameKind,
buf: impl IntoIterator<Item = BytesFrame>,
attributes: Option<<BytesFrame as Resp3Frame>::Attributes>,
) -> Result<BytesFrame, RedisProtocolError>
fn from_buffer( target: FrameKind, buf: impl IntoIterator<Item = BytesFrame>, attributes: Option<<BytesFrame as Resp3Frame>::Attributes>, ) -> Result<BytesFrame, RedisProtocolError>
§fn attributes(&self) -> Option<&<BytesFrame as Resp3Frame>::Attributes>
fn attributes(&self) -> Option<&<BytesFrame as Resp3Frame>::Attributes>
§fn take_attributes(&mut self) -> Option<<BytesFrame as Resp3Frame>::Attributes>
fn take_attributes(&mut self) -> Option<<BytesFrame as Resp3Frame>::Attributes>
§fn attributes_mut(
&mut self,
) -> Option<&mut <BytesFrame as Resp3Frame>::Attributes>
fn attributes_mut( &mut self, ) -> Option<&mut <BytesFrame as Resp3Frame>::Attributes>
§fn new_empty() -> BytesFrame
fn new_empty() -> BytesFrame
§fn new_end_stream() -> BytesFrame
fn new_end_stream() -> BytesFrame
§fn len(&self) -> usize
fn len(&self) -> usize
§fn take(&mut self) -> BytesFrame
fn take(&mut self) -> BytesFrame
self with Null, returning the original value.§fn is_end_stream_frame(&self) -> bool
fn is_end_stream_frame(&self) -> bool
§fn verbatim_string_format(&self) -> Option<&VerbatimStringFormat>
fn verbatim_string_format(&self) -> Option<&VerbatimStringFormat>
§fn as_str(&self) -> Option<&str>
fn as_str(&self) -> Option<&str>
§fn to_string(&self) -> Option<String>
fn to_string(&self) -> Option<String>
String if it can be parsed as a UTF-8 string.§fn encode_len(&self) -> usize
fn encode_len(&self) -> usize
§fn is_normal_pubsub_message(&self) -> bool
fn is_normal_pubsub_message(&self) -> bool
subscribe call.§fn is_pattern_pubsub_message(&self) -> bool
fn is_pattern_pubsub_message(&self) -> bool
psubscribe call.§fn is_shard_pubsub_message(&self) -> bool
fn is_shard_pubsub_message(&self) -> bool
ssubscribe call.§fn is_redirection(&self) -> bool
fn is_redirection(&self) -> bool
MOVED or ASK redirection.§impl<B> TryFrom<(FrameKind, B)> for BytesFramewhere
B: Into<Bytes>,
impl<B> TryFrom<(FrameKind, B)> for BytesFramewhere
B: Into<Bytes>,
§fn try_from(
_: (FrameKind, B),
) -> Result<BytesFrame, <BytesFrame as TryFrom<(FrameKind, B)>>::Error>
fn try_from( _: (FrameKind, B), ) -> Result<BytesFrame, <BytesFrame as TryFrom<(FrameKind, B)>>::Error>
source§impl TryFrom<BytesFrame> for RedisValue
impl TryFrom<BytesFrame> for RedisValue
source§type Error = RedisError
type Error = RedisError
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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