Added Debug implementations.

This commit is contained in:
Alan Jeffrey 2017-06-13 10:46:59 -05:00
parent 07f6e11485
commit a47e94c8f6
7 changed files with 53 additions and 6 deletions

View file

@ -27,6 +27,7 @@ use script_thread::{Runnable, STACK_ROOTS, trace_thread};
use servo_config::opts;
use servo_config::prefs::PREFS;
use std::cell::Cell;
use std::fmt;
use std::io::{Write, stdout};
use std::marker::PhantomData;
use std::os;
@ -45,6 +46,15 @@ pub enum CommonScriptMsg {
RunnableMsg(ScriptThreadEventCategory, Box<Runnable + Send>),
}
impl fmt::Debug for CommonScriptMsg {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CommonScriptMsg::CollectReports(_) => write!(f, "CollectReports(...)"),
CommonScriptMsg::RunnableMsg(category, _) => write!(f, "RunnableMsg({:?}, ...)", category),
}
}
}
/// A cloneable interface for communicating with an event loop.
pub trait ScriptChan: JSTraceable {
/// Send a message to the associated event loop.