MainStatusCode

Trait MainStatusCode 

Source
pub trait MainStatusCode {
    // Required method
    fn to_status_code(self) -> i32;

    // Provided method
    fn panic_status_code() -> i32 { ... }
}
Expand description

The return type of your #[px4_module_main] function.

Required Methods§

Source

fn to_status_code(self) -> i32

The status code to return.

Provided Methods§

Source

fn panic_status_code() -> i32

The status code to return in case of a panic.

−1 by default.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl MainStatusCode for Result<(), i32>

Returns 0 for Ok, and the i32 itself for Err.

Source§

impl MainStatusCode for Result<(), ()>

Returns 0 for Ok, and 1 for Err.

Source§

impl MainStatusCode for i32

Returns the i32 itself.

Source§

impl MainStatusCode for ()

Returns 0.

Implementors§