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