Plumb Responses from WASM to JS in the page

This commit is contained in:
Keavon Chambers
2021-04-10 02:48:33 -07:00
parent 22fe11b950
commit 4c546b2819
8 changed files with 104 additions and 112 deletions

View File

@@ -1,7 +1,10 @@
use crate::tools::ToolType;
use crate::Color;
use bitflags::bitflags;
use std::ops::{Deref, DerefMut};
use std::{
fmt,
ops::{Deref, DerefMut},
};
#[derive(Debug, Clone)]
#[repr(C)]
@@ -25,6 +28,14 @@ pub enum Response {
UpdateCanvas { document: String },
}
impl fmt::Display for Response {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
match self {
Response::UpdateCanvas { document: _ } => write!(formatter, "UpdateCanvas"),
}
}
}
#[derive(Debug, Clone, Default)]
pub struct Trace(Vec<TracePoint>);