to_string on any
to_string()Convert to string
Built-in value types and the methods callable on them.
anyAny type (accepts all values)
to_string on anyto_string()Convert to string
AsyncChannelReceiverNative async-runtime channel receiver returned by `channel(n)`.
recv on AsyncChannelReceiverrecv()Receive, parking until a value arrives or the channel closes
try_recv on AsyncChannelReceivertry_recv()Immediate receive attempt
recv_timeout on AsyncChannelReceiverrecv_timeout(ms)Receive with timeout
close on AsyncChannelReceiverclose()Close the receiver
to_string on AsyncChannelReceiverto_string()Convert to string
AsyncChannelSenderNative async-runtime channel sender returned by `channel(n)`.
send on AsyncChannelSendersend(value)Send, parking if the channel is full
close on AsyncChannelSenderclose()Close the sender
to_string on AsyncChannelSenderto_string()Convert to string
AsyncTaskNative async-runtime task handle returned by `spawn`.
await on AsyncTasktask.awaitWait for task
to_string on AsyncTaskto_string()Convert to string
boolBoolean type
to_string on boolto_string()Convert to string
bytesByte string type
len on byteslen()Number of bytes
is_empty on bytesis_empty()True if empty
bytes on bytesbytes()Identity byte representation
contains on bytescontains(byte_or_bytes)Contains byte value or sequence
find on bytesfind(byte_or_bytes)Index of first occurrence
count on bytescount(byte_or_bytes)Count non-overlapping occurrences
starts_with on bytesstarts_with(prefix)Starts with prefix
ends_with on bytesends_with(suffix)Ends with suffix
slice on bytesslice(start, end?)Sub-slice
split on bytessplit(sep)Split by byte value or bytes separator
replace on bytesreplace(from, to)Replace byte value or bytes sequence
reverse on bytesreverse()Reversed copy
repeat on bytesrepeat(n)Repeat n times
push on bytespush(byte)Append byte, returning new bytes
extend on bytesextend(other)Append bytes, returning new bytes
set on bytesset(index, byte)Replace byte at index, returning new bytes
pop on bytespop()Return (bytes_without_last, Option<byte>)
to_list on bytesto_list()Convert to list
to_str on bytesto_str()Decode as UTF-8
to_hex on bytesto_hex()Hex-encoded string
to_base64 on bytesto_base64()Base64-encoded string
to_string on bytesto_string()Convert to string
read_u16_le on bytesread_u16_le(offset)Read unsigned 16-bit little-endian integer
read_u16_be on bytesread_u16_be(offset)Read unsigned 16-bit big-endian integer
read_u32_le on bytesread_u32_le(offset)Read unsigned 32-bit little-endian integer
read_u32_be on bytesread_u32_be(offset)Read unsigned 32-bit big-endian integer
read_u64_le on bytesread_u64_le(offset)Read unsigned 64-bit little-endian integer if it fits in int
read_u64_be on bytesread_u64_be(offset)Read unsigned 64-bit big-endian integer if it fits in int
read_i16_le on bytesread_i16_le(offset)Read signed 16-bit little-endian integer
read_i16_be on bytesread_i16_be(offset)Read signed 16-bit big-endian integer
read_i32_le on bytesread_i32_le(offset)Read signed 32-bit little-endian integer
read_i32_be on bytesread_i32_be(offset)Read signed 32-bit big-endian integer
read_i64_le on bytesread_i64_le(offset)Read signed 64-bit little-endian integer
read_i64_be on bytesread_i64_be(offset)Read signed 64-bit big-endian integer
cellMutable reference cell type
get on cellget()Read cell value
set on cellset(val)Set cell value
update on cellupdate(fn)Apply fn to the current value, store it, and return it
to_string on cellto_string()Convert to string
ChannelBounded async channel created by `channel(n)`. Requires the `concurrency` feature.
send on Channelsend(val)Send value
recv on Channelrecv()Receive value
try_recv on Channeltry_recv()Non-blocking receive
recv_timeout on Channelrecv_timeout(ms)Receive with timeout
close on Channelclose()Close channel
to_string on Channelto_string()Convert to string
dictDictionary type (e.g. dict<string, int>)
len on dictlen()Number of entries
is_empty on dictis_empty()True if empty
keys on dictkeys()List of keys
values on dictvalues()List of values
entries on dictentries()List of (key, value) tuples
contains_key on dictcontains_key(key)Key exists
get on dictget(key)Get value by key
insert on dictinsert(key, val)Insert entry
remove on dictremove(key)Remove entry (dict) or element (set)
merge on dictmerge(other)Merge dicts
update on dictupdate(other)Merge dict (mutating)
map on dictmap(fn)Apply fn(key, value) to each entry and keep keys
filter on dictfilter(fn)Keep entries where fn(key, value) is truthy
keys_of on dictkeys_of(val)Keys with matching value
zip on dictzip(other)Merge matching keys into tuples
to_string on dictto_string()Convert to string
floatFloating-point type
to_string on floatto_string()Convert to string
fnFunction type
to_string on fnto_string()Convert to string
intInteger type
to_string on intto_string()Convert to string
listList type (e.g. list<int>)
len on listlen()Number of elements
is_empty on listis_empty()True if empty
contains on listcontains(val)Contains value
push on listpush(val)Append value
pop on listpop()Remove last element
first on listfirst()First element (Option)
last on listlast()Last element (Option)
reverse on listreverse()Reversed copy
sort on listsort()Sorted copy
sort_by on listsort_by(fn)Sort by key function
flatten on listflatten()Flatten one level
join on listjoin(sep)Join with separator
enumerate on listenumerate()Index-value tuples
zip on listzip(other)Zip with another list
map on listmap(fn)Apply function
filter on listfilter(fn)Keep matching elements
fold on listfold(init, fn)Reduce with accumulator
flat_map on listflat_map(fn)Map then flatten
any on listany(fn)True if any match
all on listall(fn)True if all match
index on listindex(val)Index of first occurrence
count on listcount(val)Count occurrences
slice on listslice(start, end?)Sublist by index
dedup on listdedup()Remove consecutive duplicates
unique on listunique()Remove all duplicates
sum on listsum()Sum of elements
window on listwindow(n)Sliding windows of size n
chunk on listchunk(n)Split into chunks of size n
reduce on listreduce(fn)Reduce list with fn (no initial value)
min on listmin()Minimum element
max on listmax()Maximum element
to_string on listto_string()Convert to string
OptionOption type (e.g. Option<int>)
Variants: Some, None
is_some on Optionis_some()True if Some
is_none on Optionis_none()True if None
unwrap on Optionunwrap()Extract value or error
unwrap_or on Optionunwrap_or(default)Unwrap or return default
expect on Optionexpect(msg)Unwrap or error
map on Optionmap(fn)Apply fn to the inner value if Some
and_then on Optionand_then(fn)Flat-map if Some
or_else on Optionor_else(fn)Call fn if None
unwrap_or_else on Optionunwrap_or_else(fn)Unwrap or call fn if None
to_string on Optionto_string()Convert to string
rangeRange type
len on rangelen()Number of values in the range
contains on rangecontains(int)True if the value is in range
to_list on rangeto_list()Materialize the range as a list
to_string on rangeto_string()Convert to string
ResultResult type (e.g. Result<int, string>)
Variants: Ok, Err
is_ok on Resultis_ok()True if Ok
is_err on Resultis_err()True if Err
unwrap on Resultunwrap()Extract Ok value or error
unwrap_or on Resultunwrap_or(default)Unwrap or return default
expect on Resultexpect(msg)Unwrap or error with message
map on Resultmap(fn)Apply fn to the Ok value
map_err on Resultmap_err(fn)Transform error
and_then on Resultand_then(fn)Flat-map on Ok
or_else on Resultor_else(fn)Call fn on Err
unwrap_or_else on Resultunwrap_or_else(fn)Unwrap or call fn with the error
to_string on Resultto_string()Convert to string
setSet type
len on setlen()Number of elements
contains on setcontains(val)Contains value
is_empty on setis_empty()True if empty
add on setadd(val)Add element to set
remove on setremove(val)Remove element from set
union on setunion(other)Union of two sets
intersection on setintersection(other)Intersection of two sets
difference on setdifference(other)Difference of two sets
to_list on setto_list()Convert to list
to_string on setto_string()Convert to string
stringString type
len on stringlen()Length
is_empty on stringis_empty()True if empty
contains on stringcontains(sub)Contains substring/element
starts_with on stringstarts_with(prefix)Starts with prefix
ends_with on stringends_with(suffix)Ends with suffix
trim on stringtrim()Strip whitespace
trim_start on stringtrim_start()Trim leading whitespace
trim_end on stringtrim_end()Trim trailing whitespace
split on stringsplit(delim)Split by delimiter
replace on stringreplace(from, to)Replace occurrences
to_upper on stringto_upper()Uppercase
to_lower on stringto_lower()Lowercase
chars on stringchars()List of characters
char_len on stringchar_len()Character count (Unicode-aware)
reverse on stringreverse()Reversed copy
find on stringfind(sub)Index of first occurrence
index on stringindex(sub)Alias for find(sub)
count on stringcount(sub)Count non-overlapping occurrences
repeat on stringrepeat(n)Repeat n times
slice on stringslice(start, end?)Substring by character index
bytes on stringbytes()List of byte values
to_int on stringto_int()Parse as integer
to_float on stringto_float()Parse as float
to_string on stringto_string()Convert to string
pad_start on stringpad_start(width, char)Pad start to width
pad_end on stringpad_end(width, char)Pad end to width
strip_prefix on stringstrip_prefix(prefix)Remove prefix if present
strip_suffix on stringstrip_suffix(suffix)Remove suffix if present
TaskAsync task handle returned by `spawn`. Requires the `concurrency` feature.
await on Tasktask.awaitWait for task
is_finished on Taskis_finished()Check if done
cancel on Taskcancel()Cancel task
is_cancelled on Taskis_cancelled()Check if cancelled
await_timeout on Taskawait_timeout(ms)Wait up to ms and return Option
to_string on Taskto_string()Convert to string
tupleTuple type
len on tuplelen()Number of elements
contains on tuplecontains(val)Contains value
to_list on tupleto_list()Convert to list
to_string on tupleto_string()Convert to string