core::rt: Rename Closeable to Close, Seekable to Seek, blocking to native

This commit is contained in:
Brian Anderson 2013-04-19 14:58:21 -07:00
parent e782e1f371
commit 7270fadfcc
8 changed files with 21 additions and 21 deletions

View file

@ -10,7 +10,7 @@
use prelude::*;
use super::misc::PathLike;
use super::{Reader, Writer, Seekable, Closeable};
use super::{Reader, Writer, Seek, Close};
use super::{IoError, SeekStyle};
/// Open a file with the default FileMode and FileAccess
@ -67,13 +67,13 @@ impl Writer for FileStream {
fn flush(&mut self) { fail!() }
}
impl Seekable for FileStream {
impl Seek for FileStream {
fn tell(&self) -> u64 { fail!() }
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
}
impl Closeable for FileStream {
impl Close for FileStream {
fn close(&mut self) { fail!() }
}

View file

@ -34,7 +34,7 @@ impl Writer for MemWriter {
fn flush(&mut self) { /* no-op */ }
}
impl Seekable for MemWriter {
impl Seek for MemWriter {
fn tell(&self) -> u64 { fail!() }
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
@ -82,7 +82,7 @@ impl Reader for MemReader {
fn eof(&mut self) -> bool { fail!() }
}
impl Seekable for MemReader {
impl Seek for MemReader {
fn tell(&self) -> u64 { fail!() }
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
@ -131,7 +131,7 @@ impl<'self> Writer for BufWriter<'self> {
fn flush(&mut self) { fail!() }
}
impl<'self> Seekable for BufWriter<'self> {
impl<'self> Seek for BufWriter<'self> {
fn tell(&self) -> u64 { fail!() }
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }
@ -159,7 +159,7 @@ impl<'self> Reader for BufReader<'self> {
fn eof(&mut self) -> bool { fail!() }
}
impl<'self> Seekable for BufReader<'self> {
impl<'self> Seek for BufReader<'self> {
fn tell(&self) -> u64 { fail!() }
fn seek(&mut self, _pos: i64, _style: SeekStyle) { fail!() }

View file

@ -146,7 +146,7 @@ mod util;
mod misc;
/// Thread-blocking implementations
pub mod blocking {
pub mod native {
/// Posix file I/O
pub mod file;
/// # XXX - implement this
@ -233,12 +233,12 @@ pub trait Writer {
///
/// Any further operations performed on a closed resource will raise
/// on `io_error`
pub trait Closeable {
pub trait Close {
/// Close the I/O resource
fn close(&mut self);
}
pub trait Stream: Reader + Writer + Closeable { }
pub trait Stream: Reader + Writer + Close { }
pub enum SeekStyle {
/// Seek from the beginning of the stream
@ -251,7 +251,7 @@ pub enum SeekStyle {
/// # XXX
/// * Are `u64` and `i64` the right choices?
pub trait Seekable {
pub trait Seek {
fn tell(&self) -> u64;
fn seek(&mut self, pos: i64, style: SeekStyle);
}

View file

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

View file

@ -33,7 +33,7 @@ impl Writer for TcpStream {
fn flush(&mut self) { fail!() }
}
impl Closeable for TcpStream {
impl Close for TcpStream {
fn close(&mut self) { fail!() }
}

View file

@ -33,7 +33,7 @@ impl Writer for UdpStream {
fn flush(&mut self) { fail!() }
}
impl Closeable for UdpStream {
impl Close for UdpStream {
fn close(&mut self) { fail!() }
}

View file

@ -33,7 +33,7 @@ impl Writer for UnixStream {
fn flush(&mut self) { fail!() }
}
impl Closeable for UnixStream {
impl Close for UnixStream {
fn close(&mut self) { fail!() }
}

View file

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