std::macros::write
macro_rules! write( ($dst:expr, $($arg:tt)*) => ({ let dst: &mut ::std::io::Writer = $dst; format_args!(|args| { ::std::fmt::write(dst, args) }, $($arg)*) }) )
Use the format!
syntax to write data into a buffer of type &mut Writer
.
See std::fmt
for more information.
Example
use std::io::MemWriter; let mut w = MemWriter::new(); write!(&mut w, "test"); write!(&mut w, "formatted {}", "arguments");