package slice
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=ff3bf3081cd3d35e0e7ac4e6c4604307df19454fbe60d0cb519f2e6832b791e3
sha512=83ad7dcd09f9670efa8b78d7cbb36860da3d5d90dcbd9f5fadaa031a78354c6bdf7de88bce38afc5a221cb2b75bdaaa9062c6650813ec088b51686ee9a22e285
doc/slice.bytes/Slice_bytes/index.html
Module Slice_bytesSource
get_int8 slice i is slice's signed 8-bit integer starting at byte index i.
get_uint8 slice i is slice's unsigned 8-bit integer starting at byte index i.
get_int16_ne slice i is slice's native-endian unsigned 16-bit integer starting at byte index i.
get_int16_le slice i is slice's little-endian unsigned 16-bit integer starting at byte index i.
get_int16_be slice i is slice's big-endian unsigned 16-bit integer starting at byte index i.
get_int16_ne slice i is slice's native-endian signed 16-bit integer starting at byte index i.
get_int16_le slice i is slice's little-endian signed 16-bit integer starting at byte index i.
get_int16_be slice i is slice's big-endian signed 16-bit integer starting at byte index i.
get_int32_ne slice i is slice's native-endian 32-bit integer starting at byte index i.
get_int32_le slice i is slice's little-endian 32-bit integer starting at byte index i.
get_int32_be slice i is slice's big-endian 32-bit integer starting at byte index i.
get_int64_ne slice i is slice's native-endian 64-bit integer starting at byte index i.
get_int64_le slice i is slice's little-endian 64-bit integer starting at byte index i.
get_int64_be slice i is slice's big-endian 64-bit integer starting at byte index i.
set t i chr modifies t in place, replacing the byte at index i with chr.
set_int8 t i v sets t's signed 8-bit integer starting at byte index i to v.
set_uint8 t i v sets t's unsigned 8-bit integer starting at byte index i to v.
set_uint16_ne t i v sets t's native-endian unsigned 16-bit integer starting at byte index i to v.
set_uint16_le t i v sets t's little-endian unsigned 16-bit integer starting at byte index i to v.
set_uint16_le t i v sets t's big-endian unsigned 16-bit integer starting at byte index i to v.
set_uint16_ne t i v sets t's native-endian signed 16-bit integer starting at byte index i to v.
set_uint16_le t i v sets t's little-endian signed 16-bit integer starting at byte index i to v.
set_uint16_le t i v sets t's big-endian signed 16-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's native-endian 32-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's little-endian 32-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's big-endian 32-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's native-endian 64-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's little-endian 64-bit integer starting at byte index i to v.
set_int32_ne t i v sets t's big-endian 64-bit integer starting at byte index i to v.
blit_from_bytes src ~src_off dst ~dst_off ~len copies len bytes from byte sequence src, starting at index src_off, to slice dst, starting at index dst_off.
Just like blit_from_bytes, but the source is a slice and the destination is a bytes sequence.
fill t off len chr modifies t in place, replacing len characters with chr, starting at off.
sub slice ~off ~len does not allocate a new bytes, but instead returns a new view into t.buf starting at off, and with length len.
Note that this does not allocate a new buffer, but instead shares the buffer of t.buf with the newly-returned slice.
shift slice n is sub slice n (length slice - n) (see sub for more details).
sub_string slice ~off ~len returns a string of length len containing the bytes of slice starting at off.
to_string slice is equivalent to sub_string slice ~off:0 ~len:(length slice).
of_string str returns a new t that contains the contents of the given string str.
string ~off ~len str is the sub-buffer of str that starts at position off (defaults to 0) and stops at position off + len (defaults to String.length str). str is fully-replaced by a fresh allocated t.