File tree 1 file changed +42
-0
lines changed
1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -1561,13 +1561,55 @@ pub fn buffered_file_writer(path: &Path) -> Result<@Writer, ~str> {
1561
1561
// FIXME (#2004) it would be great if this could be a const
1562
1562
// FIXME (#2004) why are these different from the way stdin() is
1563
1563
// implemented?
1564
+
1565
+
1566
+ /**
1567
+ * Gives a `Writer` which allows you to write to the standard output.
1568
+ *
1569
+ * # Examples
1570
+ * ~~~
1571
+ * let stdout = core::io::stdout();
1572
+ * stdout.write_str("hello\n " ) ;
1573
+ * ~~~
1574
+ * /
1564
1575
pub fn stdout ( ) -> @Writer { fd_writer ( libc:: STDOUT_FILENO as c_int , false ) }
1576
+
1577
+ /**
1578
+ * Gives a `Writer` which allows you to write to standard error.
1579
+ *
1580
+ * # Examples
1581
+ * ~~~
1582
+ * let stderr = core::io::stderr();
1583
+ * stderr.write_str("hello\n");
1584
+ * ~~~
1585
+ */
1565
1586
pub fn stderr ( ) -> @Writer { fd_writer ( libc:: STDERR_FILENO as c_int , false ) }
1566
1587
1588
+ /**
1589
+ * Prints a string to standard output.
1590
+ *
1591
+ * This string will not have an implicit newline at the end. If you want
1592
+ * an implicit newline, please see `println`.
1593
+ *
1594
+ * # Examples
1595
+ * ~~~
1596
+ * core::io::print("hello");
1597
+ * ~~~
1598
+ */
1567
1599
pub fn print ( s : & str ) {
1568
1600
stdout ( ) . write_str ( s) ;
1569
1601
}
1570
1602
1603
+ /**
1604
+ * Prints a string to standard output, followed by a newline.
1605
+ *
1606
+ * If you do not want an implicit newline, please see `print`.
1607
+ *
1608
+ * # Examples
1609
+ * ~~~
1610
+ * core::io::println("hello");
1611
+ * ~~~
1612
+ */
1571
1613
pub fn println ( s : & str ) {
1572
1614
stdout ( ) . write_line ( s) ;
1573
1615
}
You can’t perform that action at this time.
0 commit comments