pub enum Frame {
Simple(String),
Error(String),
Integer(i64),
Bulk(Bytes),
Array(Vec<Frame>),
Null,
Map(Vec<(Frame, Frame)>),
}Expand description
A single RESP3 protocol frame.
Covers the core types needed for basic Redis-compatible commands: strings, errors, integers, bulk data, arrays, null, and maps.
Variants§
Simple(String)
Simple string response, e.g. +OK\r\n.
Used for short, non-binary status replies.
Error(String)
Error response, e.g. -ERR unknown command\r\n.
Integer(i64)
64-bit signed integer, e.g. :42\r\n.
Bulk(Bytes)
Bulk (binary-safe) string, e.g. $5\r\nhello\r\n.
Uses Bytes for zero-copy-friendly handling.
Array(Vec<Frame>)
Ordered array of frames, e.g. *2\r\n+hello\r\n+world\r\n.
Null
Null value, e.g. _\r\n.
Map(Vec<(Frame, Frame)>)
Ordered map of key-value frame pairs, e.g. %1\r\n+key\r\n+val\r\n.
Uses Vec instead of HashMap to preserve insertion order (RESP3
maps are ordered) and because typical maps in Redis responses are
small enough that linear scan beats hashing overhead.
Implementations§
Trait Implementations§
impl Eq for Frame
impl StructuralPartialEq for Frame
Auto Trait Implementations§
impl !Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnsafeUnpin for Frame
impl UnwindSafe for Frame
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