ByteArrays¶
Implements¶
Constructors¶
create¶
new val create(
left': ValBytes val = reference,
right': ValBytes val = reference)
: ByteArrays val^
Parameters¶
Returns¶
- ByteArrays val^
Public Functions¶
size¶
Returns¶
- USize val
apply¶
Parameters¶
- i: USize val
Returns¶
- U8 val ?
values¶
Returns¶
arrays¶
Get the accumulated arrays represented by this instance inside an array.
Returns¶
drop¶
Parameters¶
- amount: USize val
Returns¶
- ByteArrays val
take¶
Parameters¶
- amount: USize val
Returns¶
- ByteArrays val
select¶
Get a ByteArrays instance to the selected range.
Parameters¶
Returns¶
- ByteArrays val
trim¶
Get the selected range as an array.
In best case no additional allocation, yay!
Parameters¶
Returns¶
copy_to¶
fun box copy_to(
dst: Array[U8 val] ref,
src_idx: USize val,
dst_idx: USize val,
len: USize val)
: None val
Parameters¶
Returns¶
- None val
string¶
diverges from usual Stringable.string in that it can be used to get a substring of the whole ByteArrays instance and that the result is val and in best case no additional allocation was necessary.
Parameters¶
Returns¶
- String val
array¶
Returns¶
add¶
Enable convenient concatenation via +
operator:
Parameters¶
Returns¶
- ByteArrays val
left¶
Returns¶
- ValBytes val
right¶
Returns¶
- ValBytes val
debug¶
Returns¶
- String val
find¶
Try to find sub
in this ByteArrays.
If found, returns a tuple with the first element being true
and the second element
being the starting index of sub
in this.
let ba = ByteArrays + "abc" + "def"
match ba.find("cd")
| (true, let cd_index: USize) => "found"
| (false, _) => "not found"
end
fun box find(
sub: ReadSeq[U8 val] box,
start: USize val = 0,
stop: USize val = call)
: (Bool val , USize val)
Parameters¶
Returns¶
skip_while¶
returns the first index for which f returns false, USize.max_value() if it never returns true
Parameters¶
- f: {(U8): Bool ?} val
- start: USize val
Returns¶
- USize val
skip¶
return the first index in this that doesnt contain any element of skip_chars
.
If we reach the end while skipping USize.max_value() is returned.
Parameters¶
Returns¶
- USize val
hash¶
Returns¶
- USize val
read_u8[optional T: U8 val]¶
Parameters¶
- offset: USize val
Returns¶
- U8 val ?
read_u16[optional T: U8 val]¶
Parameters¶
- offset: USize val
Returns¶
- U16 val ?
read_u32[optional T: U8 val]¶
Parameters¶
- offset: USize val
Returns¶
- U32 val ?
read_u64[optional T: U8 val]¶
Parameters¶
- offset: USize val
Returns¶
- U64 val ?
read_u128[optional T: U8 val]¶
Parameters¶
- offset: USize val
Returns¶
- U128 val ?