pub struct Keep<'a> { /* private fields */ }Expand description
A rebuild in progress, handed to the owner so it can move its references.
Implementations§
Source§impl Keep<'_>
impl Keep<'_>
Sourcepub fn moved(&mut self, at: &mut u32, len: usize)
pub fn moved(&mut self, at: &mut u32, len: usize)
Carry the len bytes at *at over, and point at at where they landed.
§Panics
If they are not inside the old blob, which is the mistake
Blob::read catches and it is caught here for the same reason.
Sourcepub fn moved_span(&mut self, span: &mut Span)
pub fn moved_span(&mut self, span: &mut Span)
The same for a Span, whose length does not change.
Sourcepub fn moved_sized(&mut self, at: &mut u32)
pub fn moved_sized(&mut self, at: &mut u32)
The same for a Blob::push_sized run, prefix and all.
The length is in the bytes being moved rather than in the reference, so
it is read off the old copy, which is the whole reason Keep::peek is
here.
Sourcepub fn peek(&self, at: u32, len: usize) -> &[u8] ⓘ
pub fn peek(&self, at: u32, len: usize) -> &[u8] ⓘ
The len bytes at at, as they were before the rebuild started.
A reference whose length is written into the bytes rather than held beside them has to read those bytes to know how many to carry over, and the blob it would normally read from is half moved by the time it is asked. This is the old copy, which is still whole.
§Panics
If they are not inside the old blob.