pub enum ParseProgress<'a> {
Incomplete,
NeedValue {
header: SetHeader<'a>,
value_len: usize,
value_prefix: &'a [u8],
header_consumed: usize,
},
Complete(Command<'a>, usize),
}Expand description
Result of incremental parsing.
Variants§
Incomplete
Need more data to continue parsing.
NeedValue
SET header parsed, waiting for value data.
The caller should:
- Allocate a buffer for the value (e.g., in cache segment)
- Copy
value_prefixto the start of that buffer - Receive remaining
value_len - value_prefix.len()bytes into the buffer - Consume
header_consumed + value_len + 2bytes from the input buffer
Fields
Complete(Command<'a>, usize)
Fully parsed command.
The tuple contains the parsed command and the number of bytes consumed.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ParseProgress<'a>
impl<'a> RefUnwindSafe for ParseProgress<'a>
impl<'a> Send for ParseProgress<'a>
impl<'a> Sync for ParseProgress<'a>
impl<'a> Unpin for ParseProgress<'a>
impl<'a> UnsafeUnpin for ParseProgress<'a>
impl<'a> UnwindSafe for ParseProgress<'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