core::rt: Remove Close trait

We will just use RAII for now.
This commit is contained in:
Brian Anderson 2013-04-24 18:26:49 -07:00
parent 3abc5b3ffb
commit 34be071353
7 changed files with 3 additions and 43 deletions

View file

@ -10,7 +10,7 @@
use prelude::*;
use super::support::PathLike;
use super::{Reader, Writer, Seek, Close};
use super::{Reader, Writer, Seek};
use super::SeekStyle;
/// # XXX
@ -69,10 +69,6 @@ impl Seek for FileStream {
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
}
impl Close for FileStream {
fn close(&mut self) { fail!() }
}
#[test]
#[ignore]
fn super_simple_smoke_test_lets_go_read_some_files_and_have_a_good_time() {

View file

@ -383,16 +383,7 @@ pub trait Writer {
fn flush(&mut self);
}
/// I/O types that may be closed
///
/// Any further operations performed on a closed resource will raise
/// on `io_error`
pub trait Close {
/// Close the I/O resource
fn close(&mut self);
}
pub trait Stream: Reader + Writer + Close { }
pub trait Stream: Reader + Writer { }
pub enum SeekStyle {
/// Seek from the beginning of the stream

View file

@ -40,10 +40,6 @@ impl Writer for FileDesc {
fn flush(&mut self) { fail!() }
}
impl Close for FileDesc {
fn close(&mut self) { fail!() }
}
impl Seek for FileDesc {
fn tell(&self) -> u64 { fail!() }
@ -72,10 +68,6 @@ impl Writer for CFile {
fn flush(&mut self) { fail!() }
}
impl Close for CFile {
fn close(&mut self) { fail!() }
}
impl Seek for CFile {
fn tell(&self) -> u64 { fail!() }
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }

View file

@ -32,10 +32,6 @@ impl Writer for TcpStream {
fn flush(&mut self) { fail!() }
}
impl Close for TcpStream {
fn close(&mut self) { fail!() }
}
pub struct TcpListener;
impl TcpListener {

View file

@ -32,10 +32,6 @@ impl Writer for UdpStream {
fn flush(&mut self) { fail!() }
}
impl Close for UdpStream {
fn close(&mut self) { fail!() }
}
pub struct UdpListener;
impl UdpListener {

View file

@ -32,10 +32,6 @@ impl Writer for UnixStream {
fn flush(&mut self) { fail!() }
}
impl Close for UnixStream {
fn close(&mut self) { fail!() }
}
pub struct UnixListener;
impl UnixListener {

View file

@ -9,7 +9,7 @@
// except according to those terms.
use prelude::*;
use super::{Reader, Writer, Close};
use super::{Reader, Writer};
pub fn stdin() -> StdReader { fail!() }
@ -39,10 +39,6 @@ impl Reader for StdReader {
fn eof(&mut self) -> bool { fail!() }
}
impl Close for StdReader {
fn close(&mut self) { fail!() }
}
pub struct StdWriter;
impl StdWriter {
@ -55,6 +51,3 @@ impl Writer for StdWriter {
fn flush(&mut self) { fail!() }
}
impl Close for StdWriter {
fn close(&mut self) { fail!() }
}