pub enum BorrowedFrame<'a> {
SimpleString(&'a [u8]),
Error(&'a str),
Integer(i64),
BulkString(&'a [u8]),
Array(&'a [BorrowedFrame<'a>]),
Null,
}
Available on crate feature
resp2
only.Expand description
A borrowed frame variant, typically used for encoding use cases.
Variants§
SimpleString(&'a [u8])
A RESP2 simple string.
Error(&'a str)
A short string representing an error.
Integer(i64)
A signed 64-bit integer.
BulkString(&'a [u8])
A byte array.
Array(&'a [BorrowedFrame<'a>])
An array of frames,
Null
A null value.
Implementations§
Source§impl<'a> BorrowedFrame<'a>
impl<'a> BorrowedFrame<'a>
Sourcepub fn encode_len(&self, int_as_bulkstring: bool) -> usize
pub fn encode_len(&self, int_as_bulkstring: bool) -> usize
Return the number of bytes needed to encode this frame.
The int_as_bulkstring
argument controls whether integers should be encoded as bulk strings, which is how Redis
expects integers in practice.
Trait Implementations§
Source§impl<'a> Clone for BorrowedFrame<'a>
impl<'a> Clone for BorrowedFrame<'a>
Source§fn clone(self: &BorrowedFrame<'a>) -> BorrowedFrame<'a>
fn clone(self: &BorrowedFrame<'a>) -> BorrowedFrame<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for BorrowedFrame<'a>
impl<'a> Debug for BorrowedFrame<'a>
Source§impl Encoder<BorrowedFrame<'_>> for Resp2
Available on crate feature codec
only.
impl Encoder<BorrowedFrame<'_>> for Resp2
Available on crate feature
codec
only.Source§impl<'a> Hash for BorrowedFrame<'a>
impl<'a> Hash for BorrowedFrame<'a>
Source§impl<'a> PartialEq for BorrowedFrame<'a>
impl<'a> PartialEq for BorrowedFrame<'a>
impl<'a> Eq for BorrowedFrame<'a>
impl<'a> StructuralPartialEq for BorrowedFrame<'a>
Auto Trait Implementations§
impl<'a> Freeze for BorrowedFrame<'a>
impl<'a> RefUnwindSafe for BorrowedFrame<'a>
impl<'a> Send for BorrowedFrame<'a>
impl<'a> Sync for BorrowedFrame<'a>
impl<'a> Unpin for BorrowedFrame<'a>
impl<'a> UnwindSafe for BorrowedFrame<'a>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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