fn PackedIntSliceEndian(comptime Int: type, comptime endian: Endian) type

A type representing a sub range of a PackedIntArrayEndian.

Parameters

Int: type,
endian: Endian,

Fields

bytes: []u8,
bit_offset: u3,
len: usize,

Functions

fn bytesRequired(int_count: usize) usize

Calculates the number of bytes required to store a desired count of Ints.

fn get(self: Self, index: usize) Int

Return the integer stored at index.

fn init(bytes: []u8, int_count: usize) Self

Initialize a packed slice using the memory at bytes, with int_count element…

Initialize a packed slice using the memory at bytes, with int_count elements. bytes must be large enough to accommodate the requested count.

fn set(self: *Self, index: usize, int: Int) void

Copy int into the slice at index.

fn slice(self: Self, start: usize, end: usize) PackedIntSliceEndian(Int, endian)

Create a PackedIntSlice of this slice from start to end.

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’s Int’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 and new_endian as the new endianness. NewInt‘s bit width must fit evenly within the slice’s Int’s total bits.

Values

Child
undefined

The integer type of the packed slice.