std/unsafe
DANGER
This package is under the terms of the Unsafe Jule. Be careful using API of this package. Doing things correct is developer's responsibility.
Index
fn Str(b: *byte, n: int): str
fn Slice[Elem](mut e: *Elem, len: int, cap: int): []Elem
fn Bytes(mut b: *byte, n: int): []byte
fn StrBytes(s: str): []byte
fn BytesStr(b: []byte): str
fn StrFromBytes(b: []byte): str
fn BytesFromStr(s: str): []byte
Str
fn Str(b: *byte, n: int): strReturns string based on b, the parameter b means first byte of string. The returned string uses n as length. Will not perform garbage collection.
Slice
fn Slice[Elem](mut e: *Elem, len: int, cap: int): []ElemReturns slice based on e, the parameter e means first element of slice. Will not perform garbage collection.
Bytes
fn Bytes(mut b: *byte, n: int): []byteAlias for Slice(b, n, n).
StrBytes
fn StrBytes(s: str): []byteAlias for Slice(&s[0], len(s), len(s)). Returns nil if len(s) == 0.
BytesStr
fn BytesStr(b: []byte): strAlias for Str(&b[0], len(b), len(b)). Returns empty string if len(b) == 0.
StrFromBytes
fn StrFromBytes(b: []byte): strSame as [BytesStr] but keeps garbage collection.
BytesFromStr
fn BytesFromStr(s: str): []byteSame as [StrBytes] but keeps garbage collection.