Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
fad77175
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fad77175
编写于
3月 25, 2014
作者:
A
Alex Crichton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
std: Touch various I/O documentation blocks
These are mostly touchups from the previous commit.
上级
a424e84a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
17 deletion
+39
-17
src/libstd/io/mod.rs
src/libstd/io/mod.rs
+0
-2
src/libstd/io/net/udp.rs
src/libstd/io/net/udp.rs
+30
-2
src/libstd/num/mod.rs
src/libstd/num/mod.rs
+5
-5
src/libstd/os.rs
src/libstd/os.rs
+4
-8
未找到文件。
src/libstd/io/mod.rs
浏览文件 @
fad77175
...
...
@@ -302,7 +302,6 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
/// A list specifying general categories of I/O error.
#[deriving(Eq,
Clone,
Show)]
#[allow(missing_doc)]
pub
enum
IoErrorKind
{
/// Any I/O error not part of this list.
OtherIoError
,
...
...
@@ -1428,7 +1427,6 @@ pub struct FileStat {
/// structure. This information is not necessarily platform independent, and may
/// have different meanings or no meaning at all on some platforms.
#[unstable]
#[allow(missing_doc)]
#[deriving(Hash)]
pub
struct
UnstableFileStat
{
/// The ID of the device containing the file.
...
...
src/libstd/io/net/udp.rs
浏览文件 @
fad77175
...
...
@@ -14,8 +14,6 @@
//! The destination and binding addresses can either be an IPv4 or IPv6
//! address. There is no corresponding notion of a server because UDP is a
//! datagram protocol.
//!
//! A UDP connection implements the `Reader` and `Writer` traits.
use
clone
::
Clone
;
use
result
::{
Ok
,
Err
};
...
...
@@ -24,6 +22,36 @@
use
rt
::
rtio
::{
RtioSocket
,
RtioUdpSocket
,
IoFactory
,
LocalIo
};
/// A User Datagram Protocol socket.
///
/// This is an implementation of a bound UDP socket. This supports both IPv4 and
/// IPv6 addresses, and there is no corresponding notion of a server because UDP
/// is a datagram protocol.
///
/// # Example
///
/// ```rust,no_run
/// # #[allow(unused_must_use)];
/// use std::io::net::udp::UdpSocket;
/// use std::io::net::ip::{Ipv4Addr, SocketAddr};
///
/// let addr = SocketAddr { ip: Ipv4Addr(127, 0, 0, 1), port: 34254 };
/// let mut socket = match UdpSocket::bind(addr) {
/// Ok(s) => s,
/// Err(e) => fail!("couldn't bind socket: {}", e),
/// };
///
/// let mut buf = [0, ..10];
/// match socket.recvfrom(buf) {
/// Ok((amt, src)) => {
/// // Send a reply to the socket we received data from
/// let buf = buf.mut_slice_to(amt);
/// buf.reverse();
/// socket.sendto(buf, src);
/// }
/// Err(e) => println!("couldn't receive a datagram: {}", e)
/// }
/// drop(socket); // close the socket
/// ```
pub
struct
UdpSocket
{
priv
obj
:
~
RtioUdpSocket
}
...
...
src/libstd/num/mod.rs
浏览文件 @
fad77175
...
...
@@ -340,11 +340,11 @@ pub enum FPCategory {
}
/// Operations on primitive floating point numbers.
//
/
//
/ TODO(#5527): In a future version of Rust, many of these functions will
become constants.
//
/
//
/ FIXME(#8888): Several of these functions have a parameter named `unused_self`. Removing it
//
/
requires #8888 to be fixed.
//
FIXME(#5527): In a future version of Rust, many of these functions will
//
become constants.
//
//
FIXME(#8888): Several of these functions have a parameter named
//
`unused_self`. Removing it
requires #8888 to be fixed.
pub
trait
Float
:
Signed
+
Round
+
Primitive
{
/// Returns the maximum of the two numbers.
fn
max
(
self
,
other
:
Self
)
->
Self
;
...
...
src/libstd/os.rs
浏览文件 @
fad77175
...
...
@@ -367,18 +367,16 @@ fn _unsetenv(n: &str) {
}
/// A low-level OS in-memory pipe.
///
/// This type is deprecated in favor of the types in `std::io::pipe`.
pub
struct
Pipe
{
/// A file descriptor representing the input end of the pipe.
/// A file descriptor representing the reading end of the pipe. Data written
/// on the `out` file descriptor can be read from this file descriptor.
input
:
c_int
,
/// A file descriptor representing the output end of the pipe.
/// A file descriptor representing the write end of the pipe. Data written
/// to this file descriptor can be read from the `input` file descriptor.
out
:
c_int
,
}
/// Creates a new low-level OS in-memory pipe.
///
/// This function is deprecated in favor of the types in `std::io::pipe`.
#[cfg(unix)]
pub
fn
pipe
()
->
Pipe
{
unsafe
{
...
...
@@ -390,8 +388,6 @@ pub fn pipe() -> Pipe {
}
/// Creates a new low-level OS in-memory pipe.
///
/// This function is deprecated in favor of the types in `std::io::pipe`.
#[cfg(windows)]
pub
fn
pipe
()
->
Pipe
{
unsafe
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录