Sync computers

This commit is contained in:
2026-03-17 18:29:00 +01:00
parent 404a681254
commit 56a00d0403
34 changed files with 2578 additions and 257 deletions

29
crates/std/src/process.rs Normal file
View File

@@ -0,0 +1,29 @@
pub struct ExitCode(isize);
impl ExitCode {
pub const SUCCESS: ExitCode = ExitCode(0);
pub fn to_isize(self) -> isize {
self.0
}
}
#[lang = "termination"]
pub trait Termination {
/// Is called to get the representation of the value as status code.
/// This status code is returned to the operating system.
fn report(self) -> ExitCode;
}
impl Termination for () {
#[inline]
fn report(self) -> ExitCode {
ExitCode::SUCCESS
}
}
impl Termination for isize {
#[inline]
fn report(self) -> ExitCode {
ExitCode(self)
}
}