rust/src/libstd/io/net
bors 1a33d7a541 auto merge of #16626 : ruud-v-a/rust/duration-reform, r=brson
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-28 22:11:18 +00:00
..
addrinfo.rs Fix misspelled comments. 2014-08-01 19:42:52 -04:00
ip.rs std: Rename various slice traits for consistency 2014-08-13 11:30:14 -07:00
mod.rs std: Deal with fallout of rtio changes 2014-06-06 22:19:57 -07:00
tcp.rs auto merge of #16626 : ruud-v-a/rust/duration-reform, r=brson 2014-08-28 22:11:18 +00:00
udp.rs Stabilization for owned (now boxed) and cell 2014-07-13 12:52:51 -07:00
unix.rs auto merge of #16626 : ruud-v-a/rust/duration-reform, r=brson 2014-08-28 22:11:18 +00:00