XU XUv0.8.8
EN

API

#cmp

import: #cmp

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

比较:struct@ Ord 与 less_*/compare_*。f64:NaN 小于非 NaN,NaN 等于 NaN。

struct@ Ord

XuAPI
struct@ Ord {
    fn less(Self) bool
}

用途

方法集约束 `Ord`。实现类型须提供下列方法。不是接口值。

参数

less fn less(Self) bool
`Ord` 上的方法:是否严格小于另一值。

(Ord) less

XuAPI
fn less(Self) bool

用途

`Ord` 上的方法:是否严格小于另一值。

参数

self Self
接收者 Self(值接收者)
other Self
另一侧同类型值(Self)

返回

bool — 是否成立

less_string

XuAPI
pub fn less_string(a string, b string) bool

用途

小于字符串。

参数

a string
左操作数(string)
b string
右操作数(string)

返回

bool — 是否成立

less_int

XuAPI
pub fn less_int(a int, b int) bool

用途

小于int。

参数

a int
左操作数(int)
b int
右操作数(int)

返回

bool — 是否成立

compare_int

XuAPI
pub fn compare_int(a int, b int) int

用途

比较int。

参数

a int
左操作数(int)
b int
右操作数(int)

返回

int — 小于 -1、相等 0、大于 1

less_f64

XuAPI
pub fn less_f64(a f64, b f64) bool

用途

小于f64。

参数

a f64
左操作数(f64)
b f64
右操作数(f64)

返回

bool — 是否成立

compare_f64

XuAPI
pub fn compare_f64(a f64, b f64) int

用途

比较f64。

参数

a f64
左操作数(f64)
b f64
右操作数(f64)

返回

int — 小于 -1、相等 0、大于 1

or_int

XuAPI
pub fn or_int(a int, b int) int

用途

orint。

参数

a int
值(int)
b int
b(int)

返回

int — 该类型的值

or_string

XuAPI
pub fn or_string(a &string, b &string) string

用途

or字符串。

参数

a &string
值(借用,调用方仍持有;类型 &string)
b &string
b(借用,调用方仍持有;类型 &string)

返回

string — 结果字符串

or_f64

XuAPI
pub fn or_f64(a f64, b f64) f64

用途

orf64。

参数

a f64
值(f64)
b f64
b(f64)

返回

f64 — 该类型的值

compare_string

XuAPI
pub fn compare_string(a string, b string) int

用途

比较字符串。

参数

a string
左操作数(string)
b string
右操作数(string)

返回

int — 小于 -1、相等 0、大于 1