XU XUv0.8.8
EN

API

#runtime

import: #runtime

counts: 14 函数, 0 方法, 1 类型, 0 常量, 0 方法集

caller(skip) 仅允许常量 skip 0 或 1。

struct Frame

XuAPI
pub struct Frame {
    pub file string
    pub line int
    pub ok bool
}

用途

公开结构体 `Frame`。

参数

file string
字段(string)
line int
字段(int)
ok bool
字段(bool)

caller

XuAPI
pub fn caller(skip int) Frame

用途

caller,返回 Frame。

参数

skip int
skip(int)

返回

Frame — 该类型的值

map_mix64

XuAPI
pub fn map_mix64(value int) int

用途

mapmix64。

参数

value int
value(int)

返回

int — 该类型的值

map_hash_int

XuAPI
pub fn map_hash_int(key int, seed int) int

用途

map哈希int。

参数

key int
键(int)
seed int
随机种子(int)

返回

int — 该类型的值

map_hash_string

XuAPI
pub fn map_hash_string(key &string, seed int) int

用途

map哈希字符串。

参数

key &string
键(借用,调用方仍持有;类型 &string)
seed int
随机种子(int)

返回

int — 该类型的值

map_insert_action

XuAPI
pub fn map_insert_action(live int, used int, cap int) int

用途

map插入action。

参数

live int
live(int)
used int
used(int)
cap int
cap(int)

返回

int — 该类型的值

starts_with

XuAPI
pub fn starts_with(s &string, prefix &string) bool

用途

判断是否以给定前缀开头。

参数

s &string
源字符串(借用,调用方仍持有;类型 &string)
prefix &string
前缀(借用,调用方仍持有;类型 &string)

返回

bool — 是否成立

is_digit

XuAPI
pub fn is_digit(c int) bool

用途

判断是否 digit。

参数

c int
字节或字符码(int)

返回

bool — 是否成立

is_alpha

XuAPI
pub fn is_alpha(c int) bool

用途

判断是否 alpha。

参数

c int
字节或字符码(int)

返回

bool — 是否成立

is_alnum

XuAPI
pub fn is_alnum(c int) bool

用途

判断是否 alnum。

参数

c int
字节或字符码(int)

返回

bool — 是否成立

is_space

XuAPI
pub fn is_space(c int) bool

用途

判断是否 space。

参数

c int
字节或字符码(int)

返回

bool — 是否成立

itoa

XuAPI
pub fn itoa(n int) string

用途

把 int 转成十进制字符串。

参数

n int
数量、长度或上限(int)

返回

string — 结果字符串

parse_int

XuAPI
pub fn parse_int(s &string) int

用途

解析为 int。失败时 throw。

参数

s &string
源字符串(借用,调用方仍持有;类型 &string)

返回

int — 该类型的值

str_bytes

XuAPI
pub fn str_bytes(s &string) []int

用途

str字节。

参数

s &string
源字符串(借用,调用方仍持有;类型 &string)

返回

[]int — 切片结果

str_runes

XuAPI
pub fn str_runes(s &string) []int

用途

strrunes。

参数

s &string
源字符串(借用,调用方仍持有;类型 &string)

返回

[]int — 切片结果