Make 'Cell<Option<JS<T>>>' traceable.

This commit is contained in:
Tetsuharu OHZEKI 2014-05-28 04:38:46 +09:00
parent 46ead90515
commit 6d9dcd087a

View file

@ -168,6 +168,12 @@ impl<T: Reflectable+Encodable<S, E>, S: Encoder<E>, E> Encodable<S, E> for Cell<
} }
} }
impl<T: Reflectable+Encodable<S, E>, S: Encoder<E>, E> Encodable<S, E> for Cell<Option<JS<T>>> {
fn encode(&self, s: &mut S) -> Result<(), E> {
self.get().encode(s)
}
}
/// for a field which contains non-POD type contains DOMType /// for a field which contains non-POD type contains DOMType
impl<T: Reflectable+Encodable<S, E>, S: Encoder<E>, E> Encodable<S, E> for RefCell<Vec<JS<T>>> { impl<T: Reflectable+Encodable<S, E>, S: Encoder<E>, E> Encodable<S, E> for RefCell<Vec<JS<T>>> {
fn encode(&self, s: &mut S) -> Result<(), E> { fn encode(&self, s: &mut S) -> Result<(), E> {