Skip to content

Commit 7a5e347

Browse files
committed
---
yaml --- r: 51439 b: refs/heads/incoming c: 57e85b5 h: refs/heads/master i: 51437: b21c2c2 51435: cca92e1 51431: a5488b5 51423: ab5ceb2 v: v3
1 parent 6d559d8 commit 7a5e347

File tree

5 files changed

+94
-2
lines changed

5 files changed

+94
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 5e6dacf32edc5b8529e6f0aafd17754d0e2e2284
9+
refs/heads/incoming: 57e85b5f947387195cec1338fcb94b7cfb88bd86
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ $(foreach target,$(CFG_TARGET_TRIPLES),\
238238

239239
CORELIB_CRATE := $(S)src/libcore/core.rc
240240
CORELIB_INPUTS := $(wildcard $(addprefix $(S)src/libcore/, \
241-
core.rc *.rs */*.rs))
241+
core.rc *.rs */*.rs */*/*rs))
242242

243243
######################################################################
244244
# Standard library variables
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use prelude::*;
12+
use super::super::sched::*;
13+
use super::super::rtio::*;
14+
use super::Stream;
15+
16+
pub struct FileStream;
17+
18+
pub impl FileStream {
19+
static fn new(path: Path) -> FileStream {
20+
fail!()
21+
}
22+
}
23+
24+
impl Stream for FileStream {
25+
fn read(&mut self, buf: &mut [u8]) -> uint {
26+
fail!()
27+
}
28+
29+
fn eof(&mut self) -> bool {
30+
fail!()
31+
}
32+
33+
fn write(&mut self, v: &const [u8]) {
34+
fail!()
35+
}
36+
}
37+
38+
#[test]
39+
#[ignore]
40+
fn super_simple_smoke_test_lets_go_read_some_files_and_have_a_good_time() {
41+
let message = "it's alright. have a good time";
42+
let filename = Path("test.txt");
43+
let mut outstream = FileStream::new(filename);
44+
outstream.write(message.to_bytes());
45+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use option::*;
12+
use comm::{GenericPort, GenericChan};
13+
14+
pub mod file;
15+
16+
// FIXME #5370 Strongly want this to be StreamError(&mut Stream)
17+
pub struct StreamError;
18+
19+
// XXX: Can't put doc comments on macros
20+
// Raised by `Stream` instances on error. Returning `true` from the handler
21+
// indicates that the `Stream` should continue, `false` that it should fail.
22+
condition! {
23+
stream_error: super::StreamError -> bool;
24+
}
25+
26+
pub trait Stream {
27+
/// Read bytes, up to the length of `buf` and place them in `buf`,
28+
/// returning the number of bytes read or an `IoError`. Reads
29+
/// 0 bytes on EOF.
30+
///
31+
/// # Failure
32+
///
33+
/// Raises the `reader_error` condition on error
34+
fn read(&mut self, buf: &mut [u8]) -> uint;
35+
36+
/// Return whether the Reader has reached the end of the stream
37+
fn eof(&mut self) -> bool;
38+
39+
/// Write the given buffer
40+
///
41+
/// # Failure
42+
///
43+
/// Raises the `writer_error` condition on error
44+
fn write(&mut self, v: &const [u8]);
45+
}

branches/incoming/src/libcore/rt/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ mod rtio;
3434
pub mod uvll;
3535
mod uvio;
3636
mod uv;
37+
#[path = "io/mod.rs"]
38+
mod io;
3739
// FIXME #5248: The import in `sched` doesn't resolve unless this is pub!
3840
pub mod thread_local_storage;
3941
mod work_queue;

0 commit comments

Comments
 (0)