fn PackedIntSlice(comptime Int: type) type
A type representing a sub range of a PackedIntArray.
Functions
fn bytesRequired(int_count: usize) usize
Calculates the number of bytes required to store a desired count of
Int
s.fn init(bytes: []u8, int_count: usize) Self
Initialize a packed slice using the memory at
bytes
, withint_count
element…Initialize a packed slice using the memory at
bytes
, withint_count
elements.bytes
must be large enough to accommodate the requested count.fn slice(self: Self, start: usize, end: usize) PackedIntSliceEndian(Int, endian)
Create a PackedIntSlice of this slice from
start
toend
.fn sliceCast(self: Self, comptime NewInt: type) PackedIntSliceEndian(NewInt, endian)
Create a PackedIntSlice of the sclice using
NewInt
as the integer type. `NewI…Create a PackedIntSlice of the sclice using
NewInt
as the integer type.NewInt
‘s bit width must fit evenly within the slice’sInt
’s total bits.fn sliceCastEndian(self: Self, comptime NewInt: type, comptime new_endian: Endian) PackedIntSliceEndian(NewInt, new_endian)
Create a PackedIntSliceEndian of the slice using
NewInt
as the integer type a…Create a PackedIntSliceEndian of the slice using
NewInt
as the integer type andnew_endian
as the new endianness.NewInt
‘s bit width must fit evenly within the slice’sInt
’s total bits.