Trait std::process::Termination[][src]

pub trait Termination {
    fn report(self) -> i32;
}
🔬 This is a nightly-only experimental API. (termination_trait_lib #43301)
Expand description

trait,用于在 main 函数中实现任意返回类型。

C-main 函数仅支持返回整数作为返回类型。 因此,实现 Termination trait 的每种类型都必须转换为整数。

默认实现将返回 libc::EXIT_SUCCESS 以指示成功执行。 如果发生故障,则返回 libc::EXIT_FAILURE

Required methods

🔬 This is a nightly-only experimental API. (termination_trait_lib #43301)

被调用以获取值的表示形式作为状态码。 此状态代码返回到操作系统。

Implementors

🔬 This is a nightly-only experimental API. (termination_trait_lib #43301)
🔬 This is a nightly-only experimental API. (termination_trait_lib #43301)
🔬 This is a nightly-only experimental API. (termination_trait_lib #43301)
🔬 This is a nightly-only experimental API. (termination_trait_lib #43301)
🔬 This is a nightly-only experimental API. (termination_trait_lib #43301)