about summary refs log tree commit diff
path: root/src/libstd/io
AgeCommit message (Collapse)AuthorLines
2014-11-11std: Rename AsRef{Reader,Writer} to ByRef{Reader,Writer}Erick Tryzelaar-3/+38
2014-11-12Fix remaining documentation to reflect fail!() -> panic!()Barosl Lee-2/+2
Throughout the docs, "failure" was replaced with "panics" if it means a task panic. Otherwise, it remained as is, or changed to "errors" to clearly differentiate it from a task panic.
2014-11-08Runtime removal: fully remove rtioAaron Turon-13/+2
This patch cleans up the remnants of the runtime IO interface. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor ttyAaron Turon-14/+12
This patch continues runtime removal by moving the tty implementations into `sys`. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor timerAaron Turon-11/+8
This patch continues runtime removal by moving out timer-related code into `sys`. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor processAaron Turon-78/+150
This patch continues the runtime removal by moving and refactoring the process implementation into the new `sys` module. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor pipes and networkingAaron Turon-245/+120
This patch continues the runtime removal by moving pipe and networking-related code into `sys`. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: refactor fsAaron Turon-224/+95
This moves the filesystem implementation from libnative into the new `sys` modules, refactoring along the way and hooking into `std::io::fs`. Because this eliminates APIs in `libnative` and `librustrt`, it is a: [breaking-change] This functionality is likely to be available publicly, in some form, from `std` in the future.
2014-11-08Runtime removal: add private sys, sys_common modulesAaron Turon-87/+5
These modules will house the code that used to be part of the runtime system in libnative. The `sys_common` module contains a few low-level but cross-platform details. The `sys` module is set up using `#[cfg()]` to include either a unix or windows implementation of a common API surface. This API surface is *not* exported directly in `libstd`, but is instead used to bulid `std::os` and `std::io`. Ultimately, the low-level details in `sys` will be exposed in a controlled way through a separate platform-specific surface, but that setup is not part of this patch.
2014-11-08Renamed Extendable to Extendgamazeps-1/+1
In order to upgrade, simply rename the Extendable trait to Extend in your code Part of #18424 [breaking-change]
2014-11-06rollup merge of #18691 : subhashb/add_clone_trait_to_filetypeAlex Crichton-1/+1
2014-11-06rollup merge of #18605 : Gankro/collect-fruitAlex Crichton-3/+3
2014-11-06Fallout from collection conventionsAlexis Beingessner-3/+3
2014-11-06Prelude: rename and consolidate extension traitsAaron Turon-15/+15
This commit renames a number of extension traits for slices and string slices, now that they have been refactored for DST. In many cases, multiple extension traits could now be consolidated. Further consolidation will be possible with generalized where clauses. The renamings are consistent with the [new `-Prelude` suffix](https://github.com/rust-lang/rfcs/pull/344). There are probably a few more candidates for being renamed this way, but that is left for API stabilization of the relevant modules. Because this renames traits, it is a: [breaking-change] However, I do not expect any code that currently uses the standard library to actually break. Closes #17917
2014-11-06Make Filetype ClonableSubhash Bhushan-1/+1
2014-11-05Fixed not compiling code in docstringVladimir Matveev-2/+2
2014-11-05Added more documentation on ToSocketAddr traitVladimir Matveev-3/+92
2014-11-05Fixed tidy errorsVladimir Matveev-3/+3
2014-11-05Fixed other tests to pass make checkVladimir Matveev-8/+5
2014-11-05Migrated io::net::udp over to ToSocketAddrVladimir Matveev-20/+34
UdpSocket constructor methods now use ToSocketAddr trait instead of SocketAddr. [breaking-change]
2014-11-05Switched io::net::tcp to use ToSocketAddrVladimir Matveev-227/+130
TcpListener and TcpStream are converted to use ToSocketAddr trait in their constructor methods. [breaking-change]
2014-11-05Added ToSocketAddr traitVladimir Matveev-0/+151
This commit adds ToSocketAddr trait to std::io::net::ip module. This trait is used for generic conversion from different types (strings, (string, u16) tuples, etc.) into a SocketAddr instance. It supports multiple output SocketAddresses when it is appropriate (e.g. DNS name resolution). This trait is going to be used by TcpStream, TcpListener and UdpSocket structures.
2014-11-03std: Fix fallout of changing `#[deriving(Clone)]`Jorge Aparicio-1/+0
2014-11-03auto merge of #18463 : japaric/rust/bytes2, r=alexcrichtonbors-1/+1
- The `BytesContainer::container_into_owned_bytes` method has been removed - Methods that used to take `BytesContainer` implementors by value, now take them by reference. In particular, this breaks some uses of Path: ``` rust Path::new("foo") // Still works path.join(another_path) -> path.join(&another_path) ``` [breaking-change] --- Re: `container_into_owned_bytes`, I've removed it because - Nothing in the whole repository uses it - Takes `self` by value, which is incompatible with unsized types (`str`) The alternative to removing this method is to split `BytesContainer` into `BytesContainer for Sized?` and `SizedBytesContainer: BytesContainer + Sized`, where the second trait only contains the `container_into_owned_bytes` method. I tried this alternative [in another branch](https://github.com/japaric/rust/commits/bytes) and it works, but it seemed better not to create a new trait for an unused method. Re: Breakage of `Path` methods We could use the idea that @alexcrichton proposed in #18457 (add blanket `impl BytesContainer for &T where T: BytesContainer` + keep taking `T: BytesContainer` by value in `Path` methods) to avoid breaking any code. r? @aturon cc #16918
2014-11-02Add Error impls to a few key error typesAaron Turon-0/+18
2014-11-01Remove unnecessary allocationsJorge Aparicio-1/+1
2014-11-01collections: Remove all collections traitsAlex Crichton-11/+2
As part of the collections reform RFC, this commit removes all collections traits in favor of inherent methods on collections themselves. All methods should continue to be available on all collections. This is a breaking change with all of the collections traits being removed and no longer being in the prelude. In order to update old code you should move the trait implementations to inherent implementations directly on the type itself. Note that some traits had default methods which will also need to be implemented to maintain backwards compatibility. [breaking-change] cc #18424
2014-10-30rollup merge of #18445 : alexcrichton/index-mutAlex Crichton-1/+1
Conflicts: src/libcollections/vec.rs
2014-10-30rollup merge of #18398 : aturon/lint-conventions-2Alex Crichton-23/+23
Conflicts: src/libcollections/slice.rs src/libcore/failure.rs src/libsyntax/parse/token.rs src/test/debuginfo/basic-types-mut-globals.rs src/test/debuginfo/simple-struct.rs src/test/debuginfo/trait-pointers.rs
2014-10-30rollup merge of #18443 : alexcrichton/deref-vec-and-stringAlex Crichton-1/+2
2014-10-30collections: Enable IndexMut for some collectionsAlex Crichton-1/+1
This commit enables implementations of IndexMut for a number of collections, including Vec, RingBuf, SmallIntMap, TrieMap, TreeMap, and HashMap. At the same time this deprecates the `get_mut` methods on vectors in favor of using the indexing notation. cc #18424
2014-10-30auto merge of #18374 : steveklabnik/rust/gh18197, r=sfacklerbors-4/+3
Fixes #18197
2014-10-30Change extensions traits to blanket implsNick Cameron-17/+18
2014-10-30changes to testsNick Cameron-2/+5
2014-10-30changes to libsNick Cameron-14/+32
2014-10-29collections: impl Deref for Vec/StringAlex Crichton-1/+2
This commit adds the following impls: impl<T> Deref<[T]> for Vec<T> impl<T> DerefMut<[T]> for Vec<T> impl Deref<str> for String This commit also removes all duplicated inherent methods from vectors and strings as implementations will now silently call through to the slice implementation. Some breakage occurred at std and beneath due to inherent methods removed in favor of those in the slice traits and std doesn't use its own prelude, cc #18424
2014-10-29Rename fail! to panic!Steve Klabnik-99/+98
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-28Fix example for BufferedReaderSteve Klabnik-4/+3
Fixes #18197
2014-10-28Update code with new lint namesAaron Turon-23/+23
2014-10-27rollup merge of #18329 : sfackler/memwriter-clearAlex Crichton-2/+7
2014-10-25Add MemWriter::from_vecSteven Fackler-2/+7
2014-10-25Deprecate UdpStreamJulian Orth-0/+12
2014-10-25Make UdpStream block until the next non-empty msg.Julian Orth-13/+20
2014-10-20auto merge of #18070 : alexcrichton/rust/spring-cleaning, r=aturonbors-19/+0
This is a large spring-cleaning commit now that the 0.12.0 release has passed removing an amount of deprecated functionality. This removes a number of deprecated crates (all still available as cargo packages in the rust-lang organization) as well as a slew of deprecated functions. All `#[crate_id]` support has also been removed. I tried to avoid anything that was recently deprecated, but I may have missed something! The major pain points of this commit is the fact that rustc/syntax have `#[allow(deprecated)]`, but I've removed that annotation so moving forward they should be cleaned up as we go.
2014-10-20auto merge of #18108 : mahkoh/rust/buffered_reader, r=alexcrichtonbors-2/+11
This optimizes `read` for the case in which the number of bytes requested is larger than the internal buffer. Note that the first comparison occurs again right afterwards and should thus be free. The second comparison occurs only in the cold branch.
2014-10-20Optimize BufferedReader::read for large buffers.Julian Orth-2/+11
This optimizes `read` for the case in which the number of bytes requested is larger than the internal buffer. Note that the first comparison occurs again right afterwards and should thus be free. The second comparison occurs only in the cold branch.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-19/+0
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-10-17auto merge of #17998 : rapha/rust/master, r=alexcrichtonbors-15/+60
2014-10-16libstd: Remove all uses of {:?}.Luqman Aden-2/+2
2014-10-16impl Buffer for ChanReaderRaphael Speyer-15/+60