pub struct Cut<'a> { /* private fields */ }Expand description
A cursor over a frozen body.
Every read either moves the cursor forward and answers, or answers
Broken::Short and leaves the cursor wherever it was. There is no way to
go backwards, because nothing that reads one of these needs to: a form is
written in the order it is read.
Implementations§
Source§impl<'a> Cut<'a>
impl<'a> Cut<'a>
Sourcepub fn uint(&mut self) -> Result<u64, Broken>
pub fn uint(&mut self) -> Result<u64, Broken>
The next LEB128 number.
Ten groups at most, which is what a u64 takes, so a payload of nothing but continuation bits cannot spin here.
Sourcepub const fn rest(&self) -> &'a [u8] ⓘ
pub const fn rest(&self) -> &'a [u8] ⓘ
Everything from here to the end, which is what a form that ends in one blob wants.
A blob at the end of a form needs no length, because the frozen body is its own length. That is the whole reason the two forms that hand back a structure Redis already knows how to lay out cost one byte of overhead.
Auto Trait Implementations§
impl<'a> Freeze for Cut<'a>
impl<'a> RefUnwindSafe for Cut<'a>
impl<'a> Send for Cut<'a>
impl<'a> Sync for Cut<'a>
impl<'a> Unpin for Cut<'a>
impl<'a> UnsafeUnpin for Cut<'a>
impl<'a> UnwindSafe for Cut<'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