Rename RenderChan -> PaintChan

This commit is contained in:
Tetsuharu OHZEKI 2014-12-08 03:58:58 +09:00
parent 9b6faaf7f0
commit 7ff790d941
7 changed files with 38 additions and 38 deletions

View file

@ -77,21 +77,21 @@ pub enum Msg {
}
#[deriving(Clone)]
pub struct RenderChan(Sender<Msg>);
pub struct PaintChan(Sender<Msg>);
impl RenderChan {
pub fn new() -> (Receiver<Msg>, RenderChan) {
impl PaintChan {
pub fn new() -> (Receiver<Msg>, PaintChan) {
let (chan, port) = channel();
(port, RenderChan(chan))
(port, PaintChan(chan))
}
pub fn send(&self, msg: Msg) {
let &RenderChan(ref chan) = self;
assert!(chan.send_opt(msg).is_ok(), "RenderChan.send: render port closed")
let &PaintChan(ref chan) = self;
assert!(chan.send_opt(msg).is_ok(), "PaintChan.send: render port closed")
}
pub fn send_opt(&self, msg: Msg) -> Result<(), Msg> {
let &RenderChan(ref chan) = self;
let &PaintChan(ref chan) = self;
chan.send_opt(msg)
}
}