pub fn serialize_op_result<R: Serialize + 'static>(
    result: Result<R, Error>,
    state: Rc<RefCell<OpState>>
) -> OpResult