base64_encode
pub fn base64_encode(src &string, alphabet &string, pad bool) string用途
base64编码。
参数
src&string- 源数据(只读借用,调用方仍持有原值;类型 &string)
alphabet&string- alphabet(只读借用,调用方仍持有原值;类型 &string)
padbool- pad(bool)
返回值
string — 结果字符串
#runtime/core标准库包 `#runtime/core`。
base64_encodepub fn base64_encode(src &string, alphabet &string, pad bool) stringbase64编码。
src &stringalphabet &stringpad boolstring — 结果字符串
base64_decodepub fn base64_decode(src &string, alphabet &string) stringbase64解码。
src &stringalphabet &stringstring — 结果字符串
task_io_progresspub fn task_io_progress()执行 task io progress 操作。
无需传入参数。
不返回值。
task_es_enterpub fn task_es_enter()执行 task es enter 操作。
无需传入参数。
不返回值。
task_es_leavepub fn task_es_leave()执行 task es leave 操作。
无需传入参数。
不返回值。
task_blockpub fn task_block()执行 task block 操作。
无需传入参数。
不返回值。
task_spawnpub fn task_spawn(entry int, fn_addr int, exit_addr int, block int)执行 task spawn 操作。
entry intfn_addr intexit_addr intblock int不返回值。
task_otherspub fn task_others() bool执行 task others 操作。
无需传入参数。
bool — 是否成立
sched_epochpub fn sched_epoch() int执行 sched epoch 操作。
无需传入参数。
int — 该类型的值
task_yieldpub fn task_yield()执行 task yield 操作。
无需传入参数。
不返回值。
chan_readypub fn chan_ready(ch int) bool执行 chan ready 操作。
ch intbool — 是否成立
task_drainpub fn task_drain()执行 task drain 操作。
无需传入参数。
不返回值。
task_exitpub fn task_exit(t int)执行 task exit 操作。
t int不返回值。
chan_newpub fn chan_new(cap int) int执行 chan new 操作。
cap intint — 该类型的值
chan_retainpub fn chan_retain(ch int)执行 chan retain 操作。
ch int不返回值。
chan_releasepub fn chan_release(ch int) int执行 chan release 操作。
ch intint — 该类型的值
chan_take_unreadpub fn chan_take_unread(ch int, dst int, esize int) int执行 chan take unread 操作。
ch intdst intesize intint — 该类型的值
chan_freepub fn chan_free(ch int)执行 chan free 操作。
ch int不返回值。
chan_try_sendpub fn chan_try_send(ch int, src int, esize int) int执行 chan try send 操作。
ch intsrc intesize intint — 该类型的值
chan_try_recvpub fn chan_try_recv(ch int, dst int, esize int) int执行 chan try recv 操作。
ch intdst intesize intint — 该类型的值
chan_sendpub fn chan_send(ch int, src int, esize int)执行 chan send 操作。
ch intsrc intesize int不返回值。
chan_recvpub fn chan_recv(ch int, dst int, esize int) bool执行 chan recv 操作。
ch intdst intesize intbool — 是否成立
chan_closepub fn chan_close(ch int)关闭chan。
ch int不返回值。
exit_processpub fn exit_process(code int)执行 exit process 操作。
code int不返回值。
write_fdpub fn write_fd(fd int, ptr int, n int) int执行 write fd 操作。
fd intptr intn intint — 该类型的值
allocpub fn alloc(size int) int执行 alloc 处理。
size intint — 该类型的值
freepub fn free(p int)执行 free 处理。
p int不返回值。
debug_free_enablepub fn debug_free_enable()执行 debug free enable 操作。
无需传入参数。
不返回值。
mem_zeropub fn mem_zero(p int, n int)执行 mem zero 操作。
p intn int不返回值。
mem_copypub fn mem_copy(dst int, src int, n int)执行 mem copy 操作。
dst intsrc intn int不返回值。
mem_eqpub fn mem_eq(a int, b int, n int) bool执行 mem eq 操作。
a intb intn intbool — 是否成立
desc_ptrpub fn desc_ptr(d int) int执行 desc ptr 操作。
d intint — 该类型的值
desc_lenpub fn desc_len(d int) int执行 desc len 操作。
d intint — 该类型的值
desc_reservepub fn desc_reserve(d int, need int, esize int)执行 desc reserve 操作。
d intneed intesize int不返回值。
slice_pushpub fn slice_push(d int, elem int, esize int)切片压入。
d intelem intesize int不返回值。
bytes_newpub fn bytes_new(out int, src int, n int)执行 bytes new 操作。
out intsrc intn int不返回值。
str_concatpub fn str_concat(out int, a int, b int)执行 str concat 操作。
out inta intb int不返回值。
string_repeatpub fn string_repeat(s &string, count int) string字符串重复。
s &stringcount intstring — 结果字符串
str_pushpub fn str_push(d int, b int)执行 str push 操作。
d intb int不返回值。
str_push_bytepub fn str_push_byte(d int, value int)执行 str push byte 操作。
d intvalue int不返回值。
str_freepub fn str_free(d int)执行 str free 操作。
d int不返回值。
str_ensure_ownedpub fn str_ensure_owned(d int)执行 str ensure owned 操作。
d int不返回值。
str_eqpub fn str_eq(a int, b int) bool执行 str eq 操作。
a intb intbool — 是否成立
str_lesspub fn str_less(a int, b int) bool执行 str less 操作。
a intb intbool — 是否成立
str_slicepub fn str_slice(out int, s int, lo int, hi int)执行 str slice 操作。
out ints intlo inthi int不返回值。
slice_slicepub fn slice_slice(out int, a int, lo int, hi int, esize int)切片切片。
out inta intlo inthi intesize int不返回值。
str_bytespub fn str_bytes(out int, s int)执行 str bytes 操作。
out ints int不返回值。
str_runespub fn str_runes(out int, s int)执行 str runes 操作。
out ints int不返回值。
print_descpub fn print_desc(fd int, d int, newline bool)执行 print desc 操作。
fd intd intnewline bool不返回值。
print_intpub fn print_int(fd int, v int, newline bool)执行 print int 操作。
fd intv intnewline bool不返回值。
print_boolpub fn print_bool(fd int, b bool, newline bool)执行 print bool 操作。
fd intb boolnewline bool不返回值。
index_panicpub fn index_panic(i int, n int)执行 index panic 操作。
i intn int不返回值。
rt_panicpub fn rt_panic(kind int)执行 rt panic 操作。
kind int不返回值。
slice_checkpub fn slice_check(lo int, hi int, n int)执行 slice check 操作。
lo inthi intn int不返回值。
record_test_failurepub fn record_test_failure()执行 record test failure 操作。
无需传入参数。
不返回值。
backtracepub fn backtrace(fd int)执行 backtrace 处理。
fd int不返回值。
err_from_strpub fn err_from_str(msg &string) int执行 err from str 操作。
msg &stringint — 该类型的值
err_msg_copypub fn err_msg_copy(out int, box int)执行 err msg copy 操作。
out intbox int不返回值。
iface_tag_panicpub fn iface_tag_panic(tag int)执行 iface tag panic 操作。
tag int不返回值。
ffi_callpub fn ffi_call(fp int, block int)执行 ffi call 操作。
fp intblock int不返回值。
ffi_sympub fn ffi_sym(idx int, sym int, libs int) int执行 ffi sym 操作。
idx intsym intlibs intint — 该类型的值
ffi_flushpub fn ffi_flush()执行 ffi flush 操作。
无需传入参数。
不返回值。
ffi_cstrpub fn ffi_cstr(d int) int执行 ffi cstr 操作。
d intint — 该类型的值
ffi_string_frompub fn ffi_string_from(out int, p int)执行 ffi string from 操作。
out intp int不返回值。
ffi_closure_allocpub fn ffi_closure_alloc(adapter int, code int, env int, stubs_base int) int执行 ffi closure alloc 操作。
adapter intcode intenv intstubs_base intint — 该类型的值
ffi_closure_take_envpub fn ffi_closure_take_env(p int, stubs_base int) int执行 ffi closure take env 操作。
p intstubs_base intint — 该类型的值
float64_bitspub fn float64_bits(f f64) int执行 float64 bits 操作。
f f64int — 该类型的值
float64_from_bitspub fn float64_from_bits(b int) f64执行 float64 from bits 操作。
b intf64 — 该类型的值
print_f64pub fn print_f64(fd int, f f64, newline bool)打印f64。
fd intf f64newline bool不返回值。
fnval_error_panicpub fn fnval_error_panic(e int)执行 fnval error panic 操作。
e int不返回值。
host_read_filepub fn host_read_file(out int, path int) int主机读取文件。
out intpath intint — 该类型的值
host_write_filepub fn host_write_file(okp int, path int, data int) int主机写入文件。
okp intpath intdata intint — 该类型的值
host_read_dirpub fn host_read_dir(out int, path int) int主机读取目录部分。
out intpath intint — 该类型的值
host_statpub fn host_stat(out int, path int) int主机元信息。
out intpath intint — 该类型的值
host_mkdirpub fn host_mkdir(okp int, path int) int主机建目录。
okp intpath intint — 该类型的值
host_renamepub fn host_rename(okp int, from int, to int) int主机重命名。
okp intfrom intto intint — 该类型的值
host_removepub fn host_remove(okp int, path int) int主机删除。
okp intpath intint — 该类型的值
host_chmodpub fn host_chmod(okp int, path int, mode int) int主机改权限。
okp intpath intmode intint — 该类型的值
host_chdirpub fn host_chdir(okp int, path int) int主机改目录。
okp intpath intint — 该类型的值
host_symlinkpub fn host_symlink(okp int, target int, link int) int执行 host symlink 操作。
okp inttarget intlink intint — 该类型的值
host_readlinkpub fn host_readlink(out int, path int) int执行 host readlink 操作。
out intpath intint — 该类型的值
host_os_openpub fn host_os_open(okp int, path int, mode int) int打开主机os。
okp intpath intmode intint — 该类型的值
host_fd_readpub fn host_fd_read(out int, fd int, max int) int读取主机fd。
out intfd intmax intint — 该类型的值
host_fd_writepub fn host_fd_write(okp int, fd int, data int) int写入主机fd。
okp intfd intdata intint — 该类型的值
host_fd_closepub fn host_fd_close(okp int, fd int) int关闭主机fd。
okp intfd intint — 该类型的值
host_fd_seekpub fn host_fd_seek(okp int, fd int, off int, whence int) int执行 host fd seek 操作。
okp intfd intoff intwhence intint — 该类型的值
host_pipepub fn host_pipe(okp int) int执行 host pipe 操作。
okp intint — 该类型的值
host_fd_peek_readpub fn host_fd_peek_read(okp int, fd int) int读取主机fd预看。
okp intfd intint — 该类型的值
host_random_fillpub fn host_random_fill(out int, n int) int执行 host random fill 操作。
out intn intint — 该类型的值
host_interface_datapub fn host_interface_data(out int, name int) int执行 host interface data 操作。
out intname intint — 该类型的值
host_socketpub fn host_socket(okp int, domain int, typ int, proto int) int主机套接字。
okp intdomain inttyp intproto intint — 该类型的值
host_bind4pub fn host_bind4(okp int, fd int, a int, b int, c int, d int, port int) int主机IPv4 bind。
okp intfd inta intb intc intd intport intint — 该类型的值
host_connect4pub fn host_connect4(okp int, fd int, a int, b int, c int, d int, port int) int主机IPv4 connect。
okp intfd inta intb intc intd intport intint — 该类型的值
host_bind6pub fn host_bind6(okp int, fd int, ip int, port int) int主机bind6。
okp intfd intip intport intint — 该类型的值
host_connect6pub fn host_connect6(okp int, fd int, ip int, port int) int主机connect6。
okp intfd intip intport intint — 该类型的值
host_bind_unixpub fn host_bind_unix(okp int, fd int, path int) int执行 host bind unix 操作。
okp intfd intpath intint — 该类型的值
host_connect_unixpub fn host_connect_unix(okp int, fd int, path int) int执行 host connect unix 操作。
okp intfd intpath intint — 该类型的值
host_listenpub fn host_listen(okp int, fd int, backlog int) int监听主机。
okp intfd intbacklog intint — 该类型的值
host_acceptpub fn host_accept(okp int, fd int) int主机接受。
okp intfd intint — 该类型的值
host_sendtopub fn host_sendto(okp int, fd int, addr int, data int) int主机发送数据报。
okp intfd intaddr intdata intint — 该类型的值
host_recvfrompub fn host_recvfrom(out int, fd int, max int) int主机收数据报。
out intfd intmax intint — 该类型的值
host_setsockopt_timeopub fn host_setsockopt_timeo(okp int, fd int, ns int) int执行 host setsockopt timeo 操作。
okp intfd intns intint — 该类型的值
host_setsockoptpub fn host_setsockopt(okp int, fd int, level int, opt int, value int) int执行 host setsockopt 操作。
okp intfd intlevel intopt intvalue intint — 该类型的值
host_socket_closepub fn host_socket_close(okp int, fd int) int关闭主机套接字。
okp intfd intint — 该类型的值
host_socket_pollpub fn host_socket_poll(okp int, fd int, events int) int执行 host socket poll 操作。
okp intfd intevents intint — 该类型的值
host_socket_waitpub fn host_socket_wait(okp int, fd int, events int, timeout_ns int) int主机套接字等待。
okp intfd intevents inttimeout_ns intint — 该类型的值
host_getsocknamepub fn host_getsockname(out int, fd int) int执行 host getsockname 操作。
out intfd intint — 该类型的值
host_getpeernamepub fn host_getpeername(out int, fd int) int执行 host getpeername 操作。
out intfd intint — 该类型的值
host_shutdownpub fn host_shutdown(okp int, fd int, how int) int执行 host shutdown 操作。
okp intfd inthow intint — 该类型的值
host_string_from_bytepub fn host_string_from_byte(out int, b int)执行 host string from byte 操作。
out intb int不返回值。
host_string_from_bytespub fn host_string_from_bytes(out int, arr int, lo int, hi int)主机字符串从字节。
out intarr intlo inthi int不返回值。
host_argspub fn host_args(out int)执行 host args 操作。
out int不返回值。
host_env_listpub fn host_env_list(out int)执行 host env list 操作。
out int不返回值。
host_env_getpub fn host_env_get(out int, name int)执行 host env get 操作。
out intname int不返回值。
host_tmp_dirpub fn host_tmp_dir(out int)执行 host tmp dir 操作。
out int不返回值。
host_cwdpub fn host_cwd(out int)执行 host cwd 操作。
out int不返回值。
host_host_namepub fn host_host_name(out int)主机主机名称。
out int不返回值。
host_pidpub fn host_pid() int主机进程 id。
无需传入参数。
int — 该类型的值
host_ppidpub fn host_ppid() int执行 host ppid 操作。
无需传入参数。
int — 该类型的值
host_uidpub fn host_uid() int主机用户 id。
无需传入参数。
int — 该类型的值
host_euidpub fn host_euid() int执行 host euid 操作。
无需传入参数。
int — 该类型的值
host_gidpub fn host_gid() int主机组 id。
无需传入参数。
int — 该类型的值
host_egidpub fn host_egid() int执行 host egid 操作。
无需传入参数。
int — 该类型的值
host_pagesizepub fn host_pagesize() int主机页大小。
无需传入参数。
int — 该类型的值
host_now_nspub fn host_now_ns() int主机当前时间纳秒。
无需传入参数。
int — 该类型的值
host_wall_time_nspub fn host_wall_time_ns() int执行 host wall time ns 操作。
无需传入参数。
int — 该类型的值
host_sleep_nspub fn host_sleep_ns(ns int)主机睡眠纳秒。
ns int不返回值。
host_wait_cancelpub fn host_wait_cancel(done int, ns int) bool主机等待取消。
done intns intbool — 是否成立
rt_signal_notifypub fn rt_signal_notify(c chan int, sig int)执行 rt signal notify 操作。
c chan intsig int不返回值。
rt_signal_stoppub fn rt_signal_stop(c chan int)执行 rt signal stop 操作。
c chan int不返回值。
rt_signal_ignorepub fn rt_signal_ignore(sig int)执行 rt signal ignore 操作。
sig int不返回值。
rt_signal_dispatchpub fn rt_signal_dispatch(sig int) bool执行 rt signal dispatch 操作。
sig intbool — 是否成立
rt_signal_has_waiterspub fn rt_signal_has_waiters() bool执行 rt signal has waiters 操作。
无需传入参数。
bool — 是否成立
host_systempub fn host_system(cmd int) int主机系统。
cmd intint — 该类型的值
host_execpub fn host_exec(path int, blob int, redir int, has_deadline bool, deadline int) int执行 host exec 操作。
path intblob intredir inthas_deadline booldeadline intint — 该类型的值
host_ui_runpub fn host_ui_run(path int) int执行 host ui run 操作。
path intint — 该类型的值
wasi_syspub fn wasi_sys(nr int, a int, b int, c int, d int, e int, f int) int执行 wasi sys 操作。
nr inta intb intc intd inte intf intint — 该类型的值
host_security_storepub fn host_security_store(out int, name int) int执行 host security store 操作。
out intname intint — 该类型的值
struct WinSocketWatchpub struct WinSocketWatch {
pub fd int
pub interest int
pub token int
pub ready int
}承载 fd、interest、token、ready 等属性的结构体。
fd intinterest inttoken intready intwin_wait_socketspub fn win_wait_sockets(watches $&[]WinSocketWatch, timeout_ns int) int执行 win wait sockets 操作。
watches $&[]WinSocketWatchtimeout_ns intint — 该类型的值
host_xacp_output_initpub fn host_xacp_output_init(capacity int) int执行 host xacp output init 操作。
capacity intint — 该类型的值
host_xacp_output_readpub fn host_xacp_output_read(out int, fd int, since int, limit int)读取主机xacp输出。
out intfd intsince intlimit int不返回值。
type_assert_failpub fn type_assert_fail()执行 type assert fail 操作。
无需传入参数。
不返回值。
assert_failpub fn assert_fail(path int, line int, col int, msg int)执行 assert fail 操作。
path intline intcol intmsg int不返回值。
intrin_make_stringpub fn intrin_make_string(out int, n int)执行 intrin make string 操作。
out intn int不返回值。
intrin_make_intspub fn intrin_make_ints(out int, n int)执行 intrin make ints 操作。
out intn int不返回值。
intrin_count_bytepub fn intrin_count_byte(s int, b int) int执行 intrin count byte 操作。
s intb intint — 该类型的值
intrin_find_bytepub fn intrin_find_byte(s int, b int, from int) int执行 intrin find byte 操作。
s intb intfrom intint — 该类型的值
string_replace_bytepub fn string_replace_byte(src &string, old_byte int, new_byte int) string执行 string replace byte 操作。
src &stringold_byte intnew_byte intstring — 结果字符串
intrin_split_bytepub fn intrin_split_byte(out int, s int, b int)执行 intrin split byte 操作。
out ints intb int不返回值。
intrin_join_stringspub fn intrin_join_strings(out int, arr int, sep int)执行 intrin join strings 操作。
out intarr intsep int不返回值。
intrin_str_boolpub fn intrin_str_bool(out int, b bool)执行 intrin str bool 操作。
out intb bool不返回值。
intrin_assert_failpub fn intrin_assert_fail(file int, line int, col int, msg int)执行 intrin assert fail 操作。
file intline intcol intmsg int不返回值。
intrin_atomic_addpub fn intrin_atomic_add(p int, d int) int执行 intrin atomic add 操作。
p intd intint — 该类型的值
intrin_atomic_caspub fn intrin_atomic_cas(p int, old int, new int) bool执行 intrin atomic cas 操作。
p intold intnew intbool — 是否成立
u64_divpub fn u64_div(a int, b int) intu64除。
a intb intint — 该类型的值
print_u64pub fn print_u64(fd int, v int, newline bool)打印u64。
fd intv intnewline bool不返回值。
intrin_event_setpub fn intrin_event_set(out int, op int, handle int, fd int, interest int, token int, timeout int) int执行 intrin event set 操作。
out intop inthandle intfd intinterest inttoken inttimeout intint — 该类型的值
map_newpub fn map_new(kstr int, vsize int, cap int) int执行 map new 操作。
kstr intvsize intcap intint — 该类型的值
map_put_haspub fn map_put_has(m int, key int, existed_out int) int执行 map put has 操作。
m intkey intexisted_out intint — 该类型的值
map_putpub fn map_put(m int, key int) int执行 map put 操作。
m intkey intint — 该类型的值
map_find_valpub fn map_find_val(m int, key int) int执行 map find val 操作。
m intkey intint — 该类型的值
map_val_ptrpub fn map_val_ptr(m int, key int) int执行 map val ptr 操作。
m intkey intint — 该类型的值
map_haspub fn map_has(m int, key int) bool执行 map has 操作。
m intkey intbool — 是否成立
map_lenpub fn map_len(m int) int执行 map len 操作。
m intint — 该类型的值
map_deletepub fn map_delete(m int, key int)执行 map delete 操作。
m intkey int不返回值。
map_freepub fn map_free(m int)执行 map free 操作。
m int不返回值。
map_takepub fn map_take(m int, key int, dst int)执行 map take 操作。
m intkey intdst int不返回值。
map_nextpub fn map_next(m int, i int) int执行 map next 操作。
m inti intint — 该类型的值
map_key_atpub fn map_key_at(m int, i int) int执行 map key at 操作。
m inti intint — 该类型的值
map_val_atpub fn map_val_at(m int, i int) int执行 map val at 操作。
m inti intint — 该类型的值
md5_hexpub fn md5_hex(h0 int, h1 int, h2 int, h3 int) stringMD5十六进制。
h0 inth1 inth2 inth3 intstring — 结果字符串
md5_compress_blockpub fn md5_compress_block(h0 $&int, h1 $&int, h2 $&int, h3 $&int, s &string, off int)MD5压缩块。
h0 $&inth1 $&inth2 $&inth3 $&ints &stringoff int不返回值。
md5_finish_tailpub fn md5_finish_tail(h0 $&int, h1 $&int, h2 $&int, h3 $&int, s &string, off int, total int) string执行 md5 finish tail 操作。
h0 $&inth1 $&inth2 $&inth3 $&ints &stringoff inttotal intstring — 结果字符串
md5_sumpub fn md5_sum(s &string) stringMD5摘要。
s &stringstring — 结果字符串
sf_addpub fn sf_add(a int, b int) int执行 sf add 操作。
a intb intint — 该类型的值
sf_subpub fn sf_sub(a int, b int) int执行 sf sub 操作。
a intb intint — 该类型的值
sf_mulpub fn sf_mul(a int, b int) int执行 sf mul 操作。
a intb intint — 该类型的值
sf_divpub fn sf_div(a int, b int) int执行 sf div 操作。
a intb intint — 该类型的值
sf_eqpub fn sf_eq(a int, b int) bool执行 sf eq 操作。
a intb intbool — 是否成立
sf_ltpub fn sf_lt(a int, b int) bool执行 sf lt 操作。
a intb intbool — 是否成立
sf_lepub fn sf_le(a int, b int) bool执行 sf le 操作。
a intb intbool — 是否成立
sf_from_intpub fn sf_from_int(x int) int执行 sf from int 操作。
x intint — 该类型的值
sf_to_intpub fn sf_to_int(a int) int执行 sf to int 操作。
a intint — 该类型的值
sf_div64pub fn sf_div64(a int, b int) int执行 sf div64 操作。
a intb intint — 该类型的值
sf_mod64pub fn sf_mod64(a int, b int) int执行 sf mod64 操作。
a intb intint — 该类型的值