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§
Sourcefn to_status_code(self) -> i32
fn to_status_code(self) -> i32
The status code to return.
Provided Methods§
Sourcefn panic_status_code() -> i32
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.
impl MainStatusCode for Result<(), i32>
Returns 0 for Ok, and the i32 itself for Err.
fn to_status_code(self) -> i32
Source§impl MainStatusCode for Result<(), ()>
Returns 0 for Ok, and 1 for Err.
impl MainStatusCode for Result<(), ()>
Returns 0 for Ok, and 1 for Err.
fn to_status_code(self) -> i32
Source§impl MainStatusCode for i32
Returns the i32 itself.
impl MainStatusCode for i32
Returns the i32 itself.
fn to_status_code(self) -> i32
Source§impl MainStatusCode for ()
Returns 0.
impl MainStatusCode for ()
Returns 0.