# QEMUExit in os::qemu_exit - Rust
API documentation for the Rust `QEMUExit` trait in crate `os`.
Keywords: rust, rustlang, rust-lang, QEMUExit

# Trait os::qemu_exit::QEMUExit

source · [−]

    pub trait QEMUExit {
        fn exit(&self, code: u32) -> !;
        fn exit_success(&self) -> !;
        fn exit_failure(&self) -> !;
    }

## Required methods

source

#### fn exit(&self, code: u32) -> !

Exit with specified return code.

Note: For `X86`, code is binary-OR’ed with `0x1` inside QEMU.

source

#### fn exit_success(&self) -> !

Exit QEMU using `EXIT_SUCCESS`, aka `0`, if possible.

Note: Not possible for `X86`.

source

#### fn exit_failure(&self) -> !

Exit QEMU using `EXIT_FAILURE`, aka `1`.

## Implementors

source

### impl QEMUExit for RISCV64