A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://doc.rust-lang.org/std/process/trait.Termination.html below:

Termination in std::process - Rust

Trait Termination1.61.0 · Source
pub trait Termination {
    // Required method
    fn report(self) -> ExitCode;
}
Expand description

A trait for implementing arbitrary return types in the main function.

The C-main function only supports returning integers. So, every type implementing the Termination trait has to be converted to an integer.

The default implementations are returning libc::EXIT_SUCCESS to indicate a successful execution. In case of a failure, libc::EXIT_FAILURE is returned.

Because different runtimes have different specifications on the return value of the main function, this trait is likely to be available only on standard library’s runtime for convenience. Other runtimes are not required to provide similar functionality.

1.61.0 · Source

Is called to get the representation of the value as status code. This status code is returned to the operating system.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4