Something went wrong. Try again.
Next Generation WASM Microkernel Operating System
wasm os rust microkernel
Something went wrong. Try again.
Rust
at trap_handler
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950// Copyright 2025. Jonas Kruckenberg//// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or// http://opensource.org/licenses/MIT>, at your option. This file may not be// copied, modified, or distributed except according to those terms.
use core::alloc::AllocError;use core::fmt;
#[derive(Debug)]pub enum SpawnError { Closed, Alloc,}
impl From<AllocError> for SpawnError { fn from(_: AllocError) -> Self { Self::Alloc }}
impl From<Closed> for SpawnError { fn from(_: Closed) -> Self { Self::Closed }}
impl fmt::Display for SpawnError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { SpawnError::Closed => f.write_str("executor was closed"), SpawnError::Alloc => f.write_str("memory allocation failed"), } }}
impl core::error::Error for SpawnError {}
#[derive(Copy, Clone, Debug, Eq, PartialEq)]pub struct Closed(pub(crate) ());
impl fmt::Display for Closed { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.pad("closed") }}
impl core::error::Error for Closed {}