pub struct ChunkSlice<'a> {
pub encoding: u8,
pub data: &'a [u8],
pub segment: u32,
pub offset: u32,
pub encoded_len: u32,
}Expand description
A zero-copy view of one chunk record inside a segment.
data borrows straight out of the mapped segment, so the slice is only
valid while the owning super::ChunkReader is alive.
Fields§
§encoding: u8Chunk encoding, i.e. one of the ENC_* constants in crate::chunkenc.
data: &'a [u8]Compressed chunk body, with the encoding byte already stripped.
segment: u32Segment the record lives in (the high 32 bits of a chunk reference).
offset: u32Byte offset of the record inside that segment.
encoded_len: u32Length of the chunk body as stored on disk. Excludes the encoding byte and the trailing CRC.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for ChunkSlice<'a>
impl<'a> Freeze for ChunkSlice<'a>
impl<'a> Move for ChunkSlice<'a>
impl<'a> RefUnwindSafe for ChunkSlice<'a>
impl<'a> Send for ChunkSlice<'a>
impl<'a> Sync for ChunkSlice<'a>
impl<'a> Unpin for ChunkSlice<'a>
impl<'a> UnsafeUnpin for ChunkSlice<'a>where
&'a [u8]: UnsafeUnpin,
impl<'a> UnwindSafe for ChunkSlice<'a>where
&'a [u8]: UnwindSafe,
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