Content-Length: 8064 | pFad | https://doc.rust-lang.org/stable/std/rc/../ffi/../rc/../path/../fmt/../macro.writeln.html

writeln in std - Rust

writeln

Macro writeln 

1.0.0 · Source
macro_rules! writeln {
    ($dst:expr $(,)?) => { ... };
    ($dst:expr, $($arg:tt)*) => { ... };
}
Expand description

Writes formatted data into a buffer, with a newline appended.

On all platforms, the newline is the LINE FEED character (\n/U+000A) alone (no additional CARRIAGE RETURN (\r/U+000D).

For more information, see write!. For information on the format string syntax, see std::fmt.

§Examples

use std::io::{Write, Result};

fn main() -> Result<()> {
    let mut w = Vec::new();
    writeln!(&mut w)?;
    writeln!(&mut w, "test")?;
    writeln!(&mut w, "formatted {}", "arguments")?;

    assert_eq!(&w[..], "\ntest\nformatted arguments\n".as_bytes());
    Ok(())
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/stable/std/rc/../ffi/../rc/../path/../fmt/../macro.writeln.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy