docs

v0.1.0 문서를 보고 있습니다. 이 버전은 더 이상 지원하지 않습니다. 최신 릴리스: v0.1.3 →

core::panic

API 참조는 영어로만 있습니다. 표준 라이브러리 소스의 영어 문서 주석에서 만듭니다.

the compiler hooks panic_fn / oom_fn / unreachable_fn: print a message to stderr and exit 101. They never return: -> ! fits any slot.

Functions

panicSource

pub const fn panic(msg: str) -> !

Abort with msg, reporting the first caller outside a #[track_caller] chain.

oomSource

pub const fn oom() -> !

Out of memory (Fatal). The runtime's allocation failures end in the same nabi_oom.

unreachableSource

pub const fn unreachable() -> !

Abort: code the program believed it could never reach ran.

assertSource

pub const fn assert(cond: bool, msg: str = "")

Abort unless cond holds.

assert_eqSource

pub const fn assert_eq<T: PartialEq + Debug>(left: T, right: T, msg: str = "")

Abort unless left == right; the message shows both via Debug.

assert_neSource

pub const fn assert_ne<T: PartialEq + Debug>(left: T, right: T, msg: str = "")

Abort if left == right; the message shows both via Debug.