Struct stackfmt::WriteTo [−][src]
pub struct WriteTo<'a> { /* fields omitted */ }
Expand description
Impl of core::fmt::Write stream that writes formatted string into provided u8 buffer.
use core::fmt;
let mut buffer = [0u8; 16];
let mut w = stackfmt::WriteTo::new(&mut buffer);
match fmt::write(&mut w, format_args!("The answer is {}", 42)) {
Ok(_) => w.as_str(),
Err(_) => "",
};
assert_eq!(buffer, "The answer is 42".as_bytes());
Implementations
Trait Implementations
Writes a string slice into this writer, returning whether the write succeeded. Read more