pub(crate) enum OffsetSizeBytes {
One = 1,
Two = 2,
Three = 3,
Four = 4,
}
Expand description
Used to unpack offset array entries such as metadata dictionary offsets or object/array value
offsets. Also used to unpack object field ids. These are always derived from a two-bit
XXX_size_minus_one
field in the corresponding header byte.
Variants§
Implementations§
Source§impl OffsetSizeBytes
impl OffsetSizeBytes
Sourcepub(crate) fn try_new(offset_size_minus_one: u8) -> Result<Self, ArrowError>
pub(crate) fn try_new(offset_size_minus_one: u8) -> Result<Self, ArrowError>
Build from the offset_size_minus_one
bits (see spec).
Sourcepub(crate) fn unpack_u32(
&self,
bytes: &[u8],
index: usize,
) -> Result<u32, ArrowError>
pub(crate) fn unpack_u32( &self, bytes: &[u8], index: usize, ) -> Result<u32, ArrowError>
Return one unsigned little-endian value from bytes
.
bytes
– the byte buffer to indexindex
– 0-based index into the buffer
Each value is self as u32
bytes wide (1, 2, 3 or 4), zero-extended to 32 bits as needed.
Sourcepub(crate) fn unpack_u32_at_offset(
&self,
bytes: &[u8],
byte_offset: usize,
offset_index: usize,
) -> Result<u32, ArrowError>
pub(crate) fn unpack_u32_at_offset( &self, bytes: &[u8], byte_offset: usize, offset_index: usize, ) -> Result<u32, ArrowError>
Return one unsigned little-endian value from bytes
.
bytes
– the byte buffer to indexbyte_offset
– number of bytes to skip before reading the first value (e.g.1
to move past a header byte).offset_index
– 0-based index after the skipped bytes (0
is the first value,1
the next, …).
Each value is self as u32
bytes wide (1, 2, 3 or 4), zero-extended to 32 bits as needed.
Trait Implementations§
Source§impl Clone for OffsetSizeBytes
impl Clone for OffsetSizeBytes
Source§fn clone(&self) -> OffsetSizeBytes
fn clone(&self) -> OffsetSizeBytes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OffsetSizeBytes
impl Debug for OffsetSizeBytes
Source§impl PartialEq for OffsetSizeBytes
impl PartialEq for OffsetSizeBytes
impl Copy for OffsetSizeBytes
impl StructuralPartialEq for OffsetSizeBytes
Auto Trait Implementations§
impl Freeze for OffsetSizeBytes
impl RefUnwindSafe for OffsetSizeBytes
impl Send for OffsetSizeBytes
impl Sync for OffsetSizeBytes
impl Unpin for OffsetSizeBytes
impl UnwindSafe for OffsetSizeBytes
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