2013-04-17 19:55:21 -05:00
|
|
|
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2013-08-01 01:12:20 -05:00
|
|
|
use option::Option;
|
|
|
|
use comm::{GenericPort, GenericChan};
|
2013-04-17 19:55:21 -05:00
|
|
|
use super::{Reader, Writer};
|
|
|
|
|
|
|
|
struct PortReader<P>;
|
|
|
|
|
|
|
|
impl<P: GenericPort<~[u8]>> PortReader<P> {
|
2013-10-21 15:08:31 -05:00
|
|
|
pub fn new(_port: P) -> PortReader<P> { fail!() }
|
2013-04-17 19:55:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<P: GenericPort<~[u8]>> Reader for PortReader<P> {
|
2013-10-21 15:08:31 -05:00
|
|
|
fn read(&mut self, _buf: &mut [u8]) -> Option<uint> { fail!() }
|
2013-04-17 19:55:21 -05:00
|
|
|
|
2013-10-21 15:08:31 -05:00
|
|
|
fn eof(&mut self) -> bool { fail!() }
|
2013-04-17 19:55:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct ChanWriter<C>;
|
|
|
|
|
|
|
|
impl<C: GenericChan<~[u8]>> ChanWriter<C> {
|
2013-10-21 15:08:31 -05:00
|
|
|
pub fn new(_chan: C) -> ChanWriter<C> { fail!() }
|
2013-04-17 19:55:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<C: GenericChan<~[u8]>> Writer for ChanWriter<C> {
|
2013-10-21 15:08:31 -05:00
|
|
|
fn write(&mut self, _buf: &[u8]) { fail!() }
|
2013-04-17 19:55:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct ReaderPort<R>;
|
|
|
|
|
|
|
|
impl<R: Reader> ReaderPort<R> {
|
2013-10-21 15:08:31 -05:00
|
|
|
pub fn new(_reader: R) -> ReaderPort<R> { fail!() }
|
2013-04-17 19:55:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<R: Reader> GenericPort<~[u8]> for ReaderPort<R> {
|
2013-10-21 15:08:31 -05:00
|
|
|
fn recv(&self) -> ~[u8] { fail!() }
|
2013-04-17 19:55:21 -05:00
|
|
|
|
2013-10-21 15:08:31 -05:00
|
|
|
fn try_recv(&self) -> Option<~[u8]> { fail!() }
|
2013-04-17 19:55:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct WriterChan<W>;
|
|
|
|
|
|
|
|
impl<W: Writer> WriterChan<W> {
|
2013-10-21 15:08:31 -05:00
|
|
|
pub fn new(_writer: W) -> WriterChan<W> { fail!() }
|
2013-04-17 19:55:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<W: Writer> GenericChan<~[u8]> for WriterChan<W> {
|
2013-10-21 15:08:31 -05:00
|
|
|
fn send(&self, _x: ~[u8]) { fail!() }
|
2013-04-17 19:55:21 -05:00
|
|
|
}
|