diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-05 22:41:23 +0000 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-05 22:41:23 +0000 |
| commit | eb0f3b02856f279f44ca54de8ba0f5f2dec6a017 (patch) | |
| tree | 0c40b52ec2cafc3a3cd22dd2da851a78ea2b023a /src/errors.rs | |
| parent | Merge branch 'main' into wasm-launchable (diff) | |
| download | sl0ppij-eb0f3b02856f279f44ca54de8ba0f5f2dec6a017.tar.gz sl0ppij-eb0f3b02856f279f44ca54de8ba0f5f2dec6a017.tar.xz sl0ppij-eb0f3b02856f279f44ca54de8ba0f5f2dec6a017.zip | |
Very borken
Diffstat (limited to 'src/errors.rs')
| -rw-r--r-- | src/errors.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/errors.rs b/src/errors.rs index e4788e20..148d7119 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -101,7 +101,7 @@ impl Display for ErrorContext { pub enum ContextType { Screen(ScreenContext), Pty(PtyContext), - #[cfg(feature = "wasm-wip")] + Plugin(PluginContext), App(AppContext), IPCServer, @@ -117,7 +117,7 @@ impl Display for ContextType { match *self { ContextType::Screen(c) => write!(f, "{}screen_thread: {}{:?}", purple, green, c), ContextType::Pty(c) => write!(f, "{}pty_thread: {}{:?}", purple, green, c), - #[cfg(feature = "wasm-wip")] + ContextType::Plugin(c) => write!(f, "{}plugin_thread: {}{:?}", purple, green, c), ContextType::App(c) => write!(f, "{}main_thread: {}{:?}", purple, green, c), ContextType::IPCServer => write!(f, "{}ipc_server: {}AcceptInput", purple, green), @@ -225,21 +225,22 @@ impl From<&PtyInstruction> for PtyContext { } // FIXME: This whole pattern *needs* a macro eventually, it's soul-crushing to write -#[cfg(feature = "wasm-wip")] + use crate::wasm_vm::PluginInstruction; -#[cfg(feature = "wasm-wip")] + #[derive(Debug, Clone, Copy, PartialEq)] pub enum PluginContext { Load, + Draw, Unload, Quit, } -#[cfg(feature = "wasm-wip")] impl From<&PluginInstruction> for PluginContext { fn from(plugin_instruction: &PluginInstruction) -> Self { match *plugin_instruction { - PluginInstruction::Load(_) => PluginContext::Load, + PluginInstruction::Load(..) => PluginContext::Load, + PluginInstruction::Draw(..) => PluginContext::Draw, PluginInstruction::Unload(_) => PluginContext::Unload, PluginInstruction::Quit => PluginContext::Quit, } |
