pub enum RangeFrame {
Show 16 variants
BlobString {
data: (usize, usize),
attributes: Option<RangeAttributes>,
},
BlobError {
data: (usize, usize),
attributes: Option<RangeAttributes>,
},
SimpleString {
data: (usize, usize),
attributes: Option<RangeAttributes>,
},
SimpleError {
data: (usize, usize),
attributes: Option<RangeAttributes>,
},
Boolean {
data: bool,
attributes: Option<RangeAttributes>,
},
Null,
Number {
data: i64,
attributes: Option<RangeAttributes>,
},
Double {
data: f64,
attributes: Option<RangeAttributes>,
},
BigNumber {
data: (usize, usize),
attributes: Option<RangeAttributes>,
},
VerbatimString {
data: (usize, usize),
format: VerbatimStringFormat,
attributes: Option<RangeAttributes>,
},
Array {
data: Vec<RangeFrame>,
attributes: Option<RangeAttributes>,
},
Map {
data: FrameMap<RangeFrame, RangeFrame>,
attributes: Option<RangeAttributes>,
},
Set {
data: FrameSet<RangeFrame>,
attributes: Option<RangeAttributes>,
},
Push {
data: Vec<RangeFrame>,
attributes: Option<RangeAttributes>,
},
Hello {
version: RespVersion,
username: Option<(usize, usize)>,
password: Option<(usize, usize)>,
setname: Option<(usize, usize)>,
},
ChunkedString((usize, usize)),
}
resp3
only.Expand description
A reference-free frame type representing ranges into an associated buffer, typically used to implement zero-copy parsing.
Variants§
BlobString
A blob of bytes.
BlobError
A blob representing an error.
SimpleString
A small string.
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
.
VerbatimString
A string to be displayed without any escaping or filtering.
Array
An array of frames.
Map
An unordered map of key-value pairs.
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: RespVersion
ChunkedString((usize, usize))
One chunk of a streaming blob.
Implementations§
Source§impl RangeFrame
impl RangeFrame
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
A context-aware length function that returns the length of the inner frame contents.
This does not return the encoded length, but rather the length of the contents of the frame such as the number of elements in an array, the size of any inner buffers, etc.
Note: Null
has a length of 0 and Hello
, Number
, Double
, and Boolean
have a length of 1.
Sourcepub fn add_attributes(
&mut self,
attributes: RangeAttributes,
) -> Result<(), RedisProtocolError>
pub fn add_attributes( &mut self, attributes: RangeAttributes, ) -> Result<(), RedisProtocolError>
Add attributes to the frame.
pub fn new_end_stream() -> Self
Trait Implementations§
Source§impl Clone for RangeFrame
impl Clone for RangeFrame
Source§fn clone(&self) -> RangeFrame
fn clone(&self) -> RangeFrame
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RangeFrame
impl Debug for RangeFrame
Source§impl Hash for RangeFrame
impl Hash for RangeFrame
Source§impl PartialEq for RangeFrame
impl PartialEq for RangeFrame
impl Eq for RangeFrame
impl StructuralPartialEq for RangeFrame
Auto Trait Implementations§
impl Freeze for RangeFrame
impl RefUnwindSafe for RangeFrame
impl Send for RangeFrame
impl Sync for RangeFrame
impl Unpin for RangeFrame
impl UnwindSafe for RangeFrame
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