summary refs log tree commit diff
path: root/src/libstd/io/net
AgeCommit message (Collapse)AuthorLines
2014-10-07Put slicing syntax behind a feature gate.Nick Cameron-15/+18
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-07Use slice syntax instead of slice_to, etc.Nick Cameron-4/+4
2014-10-02Revert "Use slice syntax instead of slice_to, etc."Aaron Turon-4/+4
This reverts commit 40b9f5ded50ac4ce8c9323921ec556ad611af6b7.
2014-10-02Revert "Put slicing syntax behind a feature gate."Aaron Turon-18/+15
This reverts commit 95cfc35607ccf5f02f02de56a35a9ef50fa23a82.
2014-10-02Put slicing syntax behind a feature gate.Nick Cameron-15/+18
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-02Use slice syntax instead of slice_to, etc.Nick Cameron-4/+4
2014-10-01Remove iotest macroAaron Turon-166/+267
This commit removes the `iotest!` macro from `std::io`. The macro was primarily used to ensure that all io-related tests were run on both libnative and libgreen/librustuv. However, now that the librustuv stack is being removed, the macro is no longer needed. See the [runtime removal RFC](https://github.com/rust-lang/rfcs/pull/230) for more context. [breaking-change]
2014-09-30Fix libstdSteven Fackler-1/+1
2014-09-27auto merge of #17506 : sfackler/rust/cfg-attr, r=alexcrichtonbors-3/+3
cc #17490 Reopening of #16230
2014-09-25Ignore two I/O tests that are failing on the win32 botBrian Anderson-0/+2
2014-09-23Deprecate `#[ignore(cfg(...))]`Steven Fackler-3/+3
Replace `#[ignore(cfg(a, b))]` with `#[cfg_attr(all(a, b), ignore)]`
2014-09-21Remove #[allow(deprecated)] from libstdAlex Crichton-4/+12
2014-09-17rollup merge of #17297 : treeman/net-unixAlex Crichton-4/+3
2014-09-16Fallout from renamingAaron Turon-5/+5
2014-09-16Rename std::io::net::unix to std::io::net::pipe.Jonas Hietala-4/+3
Renamed as we may support pipes for other platforms. Closes #12093 [breaking-change]
2014-08-28auto merge of #16626 : ruud-v-a/rust/duration-reform, r=brsonbors-3/+3
This changes the internal representation of `Duration` from days: i32, secs: i32, nanos: u32 to secs: i64, nanos: i32 This resolves #16466. Note that `nanos` is an `i32` and not `u32` as suggested, because `i32` is easier to deal with, and it is not exposed anyway. Some methods now take `i64` instead of `i32` due to the increased range. Some methods, like `num_milliseconds`, now return an `Option<i64>` instead of `i64`, because the range of `Duration` is now larger than e.g. 2^63 milliseconds. A few remarks: - Negating `MIN` is impossible. I chose to return `MAX` as `-MIN`, but it is one nanosecond less than the actual negation. Is this the desired behaviour? - In `std::io::timer`, some functions accept a `Duration`, which is internally converted into a number of milliseconds. However, the range of `Duration` is now larger than 2^64 milliseconds. There is already a FIXME in the file that this should be addressed (without a ticket number though). I chose to silently use 0 ms if the duration is too long. Is that right, as long as the backend still uses milliseconds? - Negative durations are not formatted correctly, but they were not formatted correctly before either.
2014-08-24native: clone/close_accept for win32 pipesAlex Crichton-2/+3
This commits takes a similar strategy to the previous commit to implement close_accept and clone for the native win32 pipes implementation. Closes #15595
2014-08-24native: Implement clone/close_accept for unixAlex Crichton-0/+227
This commits implements {Tcp,Unix}Acceptor::{clone,close_accept} methods for unix. A windows implementation is coming in a later commit. The clone implementation is based on atomic reference counting (as with all other clones), and the close_accept implementation is based on selecting on a self-pipe which signals that a close has been seen.
2014-08-21libstd: Limit Duration range to i64 milliseconds.Ruud van Asseldonk-14/+2
This enables `num_milliseconds` to return an `i64` again instead of `Option<i64>`, because it is guaranteed not to overflow. The Duration range is now rougly 300e6 years (positive and negative), whereas it was 300e9 years previously. To put these numbers in perspective, 300e9 years is about 21 times the age of the universe (according to Wolfram|Alpha). 300e6 years is about 1/15 of the age of the earth (according to Wolfram|Alpha).
2014-08-20libstd: Refactor Duration.Ruud van Asseldonk-5/+17
This changes the internal representation of `Duration` from days: i32, secs: i32, nanos: u32 to secs: i64, nanos: i32 This resolves #16466. Some methods now take `i64` instead of `i32` due to the increased range. Some methods, like `num_milliseconds`, now return an `Option<i64>` instead of `i64`, because the range of `Duration` is now larger than e.g. 2^63 milliseconds.
2014-08-16librustc: Forbid external crates, imports, and/or items from beingPatrick Walton-6/+1
declared with the same name in the same scope. This breaks several common patterns. First are unused imports: use foo::bar; use baz::bar; Change this code to the following: use baz::bar; Second, this patch breaks globs that import names that are shadowed by subsequent imports. For example: use foo::*; // including `bar` use baz::bar; Change this code to remove the glob: use foo::{boo, quux}; use baz::bar; Or qualify all uses of `bar`: use foo::{boo, quux}; use baz; ... baz::bar ... Finally, this patch breaks code that, at top level, explicitly imports `std` and doesn't disable the prelude. extern crate std; Because the prelude imports `std` implicitly, there is no need to explicitly import it; just remove such directives. The old behavior can be opted into via the `import_shadowing` feature gate. Use of this feature gate is discouraged. This implements RFC #116. Closes #16464. [breaking-change]
2014-08-14auto merge of #16332 : brson/rust/slicestab, r=aturonbors-2/+2
This implements some of the recommendations from https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-06.md. Explanation in commits.
2014-08-13std: Fix build errorsBrian Anderson-2/+2
2014-08-13std: Make connect_timeout return Err on zero durationBrian Anderson-12/+16
[breaking-change]
2014-08-13Fix various fallout from timer changesBrian Anderson-1/+2
2014-08-13std: connect_timeout requires a positive DurationBrian Anderson-9/+27
This is only breaking if you were previously specifying a duration of zero for some mysterious reason. [breaking-change]
2014-08-13std: Make the TCP/UDP connect_timeout methods take DurationBrian Anderson-6/+14
[breaking-change]
2014-08-13std: Rename various slice traits for consistencyBrian Anderson-2/+2
ImmutableVector -> ImmutableSlice ImmutableEqVector -> ImmutableEqSlice ImmutableOrdVector -> ImmutableOrdSlice MutableVector -> MutableSlice MutableVectorAllocating -> MutableSliceAllocating MutableCloneableVector -> MutableCloneableSlice MutableOrdVector -> MutableOrdSlice These are all in the prelude so most code will not break. [breaking-change]
2014-08-06Use byte literals in libstdnham-6/+6
2014-08-01Fix misspelled comments.Joseph Crail-1/+1
2014-07-31Tweak error reporting in io::net::tcp testsKevin Ballard-4/+4
Errors can be printed with {}, printing with {:?} does not work very well. Not actually related to this PR, but it came up when running the tests and now is as good a time to fix it as any.
2014-07-23Remove kludgy imports from vec! macroBrian Anderson-0/+1
2014-07-13Stabilization for `owned` (now `boxed`) and `cell`Aaron Turon-3/+3
This PR is the outcome of the library stabilization meeting for the `liballoc::owned` and `libcore::cell` modules. Aside from the stability attributes, there are a few breaking changes: * The `owned` modules is now named `boxed`, to better represent its contents. (`box` was unavailable, since it's a keyword.) This will help avoid the misconception that `Box` plays a special role wrt ownership. * The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move` method is renamed to `downcast`, in both cases to improve clarity. * The recently-added `AnySendOwnExt` extension trait is removed; it was not being used and is unnecessary. [breaking-change]
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-49/+50
[breaking-change]
2014-07-03Rename set_broadast() to set_broadcast().Joseph Crail-1/+7
2014-07-03Fix spelling errors.Joseph Crail-1/+1
2014-07-02Add `recvfrom` and `sendto`.OGINO Masanori-0/+13
We leave them for compatibility, but mark them as deprecated. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-07-02Rename recvfrom -> recv_from, sendto -> send_to.OGINO Masanori-34/+34
POSIX has recvfrom(2) and sendto(2), but their name seem not to be suitable with Rust. We already renamed getpeername(2) and getsockname(2), so I think it makes sense. Alternatively, `receive_from` would be fine. However, we have `.recv()` so I chose `recv_from`. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-29rustuv: Don't zero-out data on clonesAlex Crichton-0/+40
When cloning a stream, the data is already guaranteed to be in a consistent state, so there's no need to perform a zeroing. This prevents segfaults as seen in #15231 Closes #15231
2014-06-27std::io: Use re-exported pathes in examples.OGINO Masanori-3/+3
We use re-exported pathes (e.g. std::io::Command) and original ones (e.g. std::io::process::Command) together in examples now. Using re-exported ones consistently avoids confusion. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-10/+10
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-15Register new snapshotsAlex Crichton-8/+8
2014-06-08core: Rename `container` mod to `collections`. Closes #12543Brian Anderson-1/+1
Also renames the `Container` trait to `Collection`. [breaking-change]
2014-06-06libs: Fix miscellaneous fallout of librustrtAlex Crichton-1/+2
2014-06-06std: Deal with fallout of rtio changesAlex Crichton-43/+154
2014-06-01std: Drop Total from Total{Eq,Ord}Alex Crichton-2/+2
This completes the last stage of the renaming of the comparison hierarchy of traits. This change renames TotalEq to Eq and TotalOrd to Ord. In the future the new Eq/Ord will be filled out with their appropriate methods, but for now this change is purely a renaming change. [breaking-change]
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-2/+2
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-27std: Rename strbuf operations to stringRicho Healey-3/+3
[breaking-change]
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-68/+70
2014-05-15Updates with core::fmt changesAlex Crichton-8/+6
1. Wherever the `buf` field of a `Formatter` was used, the `Formatter` is used instead. 2. The usage of `write_fmt` is minimized as much as possible, the `write!` macro is preferred wherever possible. 3. Usage of `fmt::write` is minimized, favoring the `write!` macro instead.